Subgroup: Map

Class: QgsMapToolEdit

class qgis.gui.QgsMapToolEdit

Bases: qgis._gui.QgsMapTool

Base class for map tools that edit vector geometry

Methods

action Return associated action with map tool or NULL if no action is associated
activate called when set as currently active map tool
addTopologicalPoints Adds vertices to other features to keep topology up to date, e.g.
blockSignals
button Return associated button with map tool or NULL if no button is associated
canvas returns pointer to the tool’s map canvas
canvasDoubleClickEvent Mouse double-click event for overriding.
canvasMoveEvent Mouse move event for overriding.
canvasPressEvent Mouse press event for overriding.
canvasReleaseEvent Mouse release event for overriding.
childEvent
children
clean convenient method to clean members
connectNotify
createGeometryRubberBand
createRubberBand Creates a rubber band with the color/line width from the QGIS settings.
currentVectorLayer Returns the current vector layer of the map canvas or 0
customEvent
deactivate called when map tool is being deactivated
defaultZValue Return default Z value
deleteLater
digitizingFillColor Returns fill color for rubber bands (from global settings)
digitizingStrokeColor Returns stroke color for rubber bands (from global settings)
digitizingStrokeWidth Returns stroke width for rubber bands (from global settings)
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
flags
gestureEvent gesture event for overriding. Default implementation does nothing.
inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
keyPressEvent Key event for overriding.
keyReleaseEvent Key event for overriding.
killTimer
metaObject
moveToThread
notifyNotEditableLayer Display a timed message bar noting the active vector layer is not editable.
notifyNotVectorLayer Display a timed message bar noting the active layer is not vector.
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
searchRadiusMM Get search radius in mm.
searchRadiusMU Get search radius in map units for given context.
sender
senderSignalIndex
setAction Use this to associate a QAction to this maptool.
setButton Use this to associate a button to this maptool.
setCursor Set a user defined cursor
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
toCanvasCoordinates
toLayerCoordinates
toMapCoordinates
toMapCoordinatesV2
toolName Emit map tool changed with the old tool
tr
wheelEvent Mouse wheel event for overriding.

Attributes

AllowZoomRect
EditTool
Transient
activated signal emitted once the map tool is activated [signal]
deactivated signal emitted once the map tool is deactivated [signal]
destroyed destroyed(self, QObject = None) [signal]
messageDiscarded emit signal to clear previous message [signal]
messageEmitted emit a message [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
addTopologicalPoints(self, geom: Iterable[QgsPointXY]) → int

Adds vertices to other features to keep topology up to date, e.g. to neighbouring polygons.

Parameters:geom – list of points (in layer coordinate system)
Returns:0 in case of success
childEvent()
connectNotify()
createGeometryRubberBand(self, geometryType: QgsWkbTypes.GeometryType = QgsWkbTypes.LineGeometry, alternativeBand: bool = False) → QgsGeometryRubberBand
createRubberBand(self, geometryType: QgsWkbTypes.GeometryType = QgsWkbTypes.LineGeometry, alternativeBand: bool = False) → QgsRubberBand

Creates a rubber band with the color/line width from the QGIS settings. The caller takes ownership of the returned object

Parameters:
  • geometryType
  • alternativeBand – if true, rubber band will be set with more transparency and a dash pattern. default is false.
currentVectorLayer(self) → QgsVectorLayer

Returns the current vector layer of the map canvas or 0

customEvent()
defaultZValue(self) → float

Return default Z value Use for set Z coordinate to new vertex for 2.5d geometries

digitizingFillColor() → QColor

Returns fill color for rubber bands (from global settings)

digitizingStrokeColor() → QColor

Returns stroke color for rubber bands (from global settings)

digitizingStrokeWidth() → int

Returns stroke width for rubber bands (from global settings)

disconnectNotify()
flags(self) → QgsMapTool.Flags
isSignalConnected()
notifyNotEditableLayer(self)

Display a timed message bar noting the active vector layer is not editable.

notifyNotVectorLayer(self)

Display a timed message bar noting the active layer is not vector.

receivers()
sender()
senderSignalIndex()
timerEvent()
toCanvasCoordinates()
toLayerCoordinates()
toMapCoordinates()
toMapCoordinatesV2()