Class: QgsMapToolEdit¶
Base class for map tools that edit vector geometry
Class Hierarchy¶
Base classes¶
Abstract base class for all map tools. Map tools are user interactive tools for manipulating the map canvas. For example map pan and zoom features are implemented as map tools. |
|
Subclasses¶
The |
Methods
Adds a list of vertices to other features to keep topology up to date, e.g. to neighbouring polygons. |
|
Creates a geometry rubber band with the color/line width from the QGIS settings. |
|
Creates a rubber band with the color/line width from the QGIS settings. |
|
Returns the current vector layer of the map canvas or 0 |
|
Display a timed message bar noting the active vector layer is not editable. |
|
Display a timed message bar noting the active layer is not vector. |
Static Methods
Returns default M value. |
|
Returns default Z value. |
|
Returns fill color for rubber bands (from global settings) |
|
Returns stroke color for rubber bands (from global settings) |
|
Returns stroke width for rubber bands (from global settings) |
Attributes
- class qgis.gui.QgsMapToolEdit[source]¶
Bases:
QgsMapTool
- InvalidCanvas = 1¶
- InvalidLayer = 2¶
- Success = 0¶
- class TopologicalResult¶
Bases:
int
- addTopologicalPoints(self, vertices: Iterable[QgsPointXY]) QgsMapToolEdit.TopologicalResult [source]¶
Adds a list of
vertices
to other features to keep topology up to date, e.g. to neighbouring polygons. Thevertices
list specifies a set of topological points to add, in the layer’s coordinate reference system.Deprecated since version 3.12: Will be removed in QGIS 4.0. Use the variant which accepts
QgsPoint
objects instead ofQgsPointXY
.- Parameters:
vertices (Iterable[QgsPointXY])
- Return type:
- addTopologicalPoints(self, vertices: Iterable[QgsPoint]) QgsMapToolEdit.TopologicalResult [source]
Adds a list of
vertices
to other features to keep topology up to date, e.g. to neighbouring polygons. Thevertices
list specifies a set of topological points to add, in the layer’s coordinate reference system.Added in version 3.10.
- Parameters:
vertices (Iterable[QgsPoint])
- Return type:
- createGeometryRubberBand(self, geometryType: Qgis.GeometryType = Qgis.GeometryType.Line, alternativeBand: bool = False) QgsGeometryRubberBand | None [source]¶
Creates a geometry rubber band with the color/line width from the QGIS settings. The caller takes ownership of the returned object
- Parameters:
geometryType (Qgis.GeometryType = Qgis.GeometryType.Line)
alternativeBand (bool = False) – if
True
, rubber band will be set with more transparency and a dash pattern. default isFalse
.
- Return type:
Optional[QgsGeometryRubberBand]
- createRubberBand(self, geometryType: Qgis.GeometryType = Qgis.GeometryType.Line, alternativeBand: bool = False) QgsRubberBand | None [source]¶
Creates a rubber band with the color/line width from the QGIS settings. The caller takes ownership of the returned object
- Parameters:
geometryType (Qgis.GeometryType = Qgis.GeometryType.Line)
alternativeBand (bool = False) – if
True
, rubber band will be set with more transparency and a dash pattern. default isFalse
.
- Return type:
Optional[QgsRubberBand]
- currentVectorLayer(self) QgsVectorLayer | None [source]¶
Returns the current vector layer of the map canvas or 0
- Return type:
Optional[QgsVectorLayer]
- static defaultMValue() float [source]¶
Returns default M value. Used for setting M coordinate to new vertex.
Added in version 3.20.
- Return type:
float
- static defaultZValue() float [source]¶
Returns default Z value. Used for setting Z coordinate to new vertex.
- Return type:
float
- static digitizingFillColor() QColor [source]¶
Returns fill color for rubber bands (from global settings)
- Return type:
QColor
- static digitizingStrokeColor() QColor [source]¶
Returns stroke color for rubber bands (from global settings)
- Return type:
QColor
- static digitizingStrokeWidth() int [source]¶
Returns stroke width for rubber bands (from global settings)
- Return type:
int