Class: QgsMapToolEmitPoint

class qgis.gui.QgsMapToolEmitPoint

Bases: QgsMapTool

A map tool that simply emits a point when clicking on the map. Connecting a slot to its canvasClicked() signal will let you implement custom behavior for the passed in point.

QgsMapToolEmitPoint(canvas: QgsMapCanvas) constructor

Methods

canvasMoveEvent

param e

canvasPressEvent

param e

canvasReleaseEvent

param e

childEvent

connectNotify

customEvent

disconnectNotify

flags

rtype

QgsMapTool.Flags

isSignalConnected

receivers

sender

senderSignalIndex

setToolName

Sets the tool’s name.

timerEvent

toCanvasCoordinates

Transforms a point from map coordinates to screen coordinates.

toLayerCoordinates

Transforms a point from screen coordinates to layer coordinates.

toMapCoordinates

Transforms a point from screen coordinates to map coordinates.

toMapCoordinatesV2

Transforms a point from layer coordinates to map coordinates (which is different in case reprojection is used).

Signals

canvasClicked

signal emitted on canvas click [signal]

canvasClicked

signal emitted on canvas click [signal]

Parameters
  • point (QgsPointXY) –

  • button (Qt.MouseButton) –

canvasMoveEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

canvasPressEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

canvasReleaseEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
flags(self)QgsMapTool.Flags
Return type

QgsMapTool.Flags

isSignalConnected(self, QMetaMethod)bool
receivers(self, PYQT_SIGNAL)int
sender(self)QObject
senderSignalIndex(self)int
setToolName(self, name: str)

Sets the tool’s name.

See also

toolName()

New in version 3.20.

timerEvent(self, QTimerEvent)
toCanvasCoordinates(self, point: QgsPointXY)QPoint

Transforms a point from map coordinates to screen coordinates.

toLayerCoordinates(self, layer: QgsMapLayer, point: QPoint)QgsPointXY

Transforms a point from screen coordinates to layer coordinates.

toLayerCoordinates(self, layer: QgsMapLayer, point: QgsPointXY) -> QgsPointXY Transforms a point from map coordinates to layer coordinates.

toLayerCoordinates(self, layer: QgsMapLayer, rect: QgsRectangle) -> QgsRectangle Transforms a rect from map coordinates to layer coordinates.

toMapCoordinates(self, point: QPoint)QgsPointXY

Transforms a point from screen coordinates to map coordinates.

toMapCoordinates(self, layer: QgsMapLayer, point: QgsPointXY) -> QgsPointXY Transforms a point from layer coordinates to map coordinates (which is different in case reprojection is used).

toMapCoordinatesV2(self, layer: QgsMapLayer, point: QgsPoint)QgsPoint

Transforms a point from layer coordinates to map coordinates (which is different in case reprojection is used).

Note

This method is available in the Python bindings as toMapCoordinatesV2.