Class: QgsTrackedVectorLayerTools¶
Vector layer tools subclass which “tracks” edits.
Class Hierarchy¶
Base classes¶
Used to handle basic editing operations on vector layers. |
|
Methods
Delete all features which have been added via this object. |
|
Set the vector layer tools that will be used to interact with the data |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsTrackedVectorLayerTools. See the FAQ for more details.
This method calls the addFeature method of the backend |
- class qgis.core.QgsTrackedVectorLayerTools[source]¶
Bases:
QgsVectorLayerTools
- virtual addFeatureV2(self, layer: QgsVectorLayer | None, defaultValues: Dict[int, Any], defaultGeometry: QgsGeometry, context: QgsVectorLayerToolsContext)[source]¶
This method calls the addFeature method of the backend
QgsVectorLayerTools
- Parameters:
layer (Optional[QgsVectorLayer]) – The layer to which the feature should be added
defaultValues (Dict[int, Any]) – Default values for the feature to add
defaultGeometry (QgsGeometry) – A default geometry to add to the feature
context (
QgsVectorLayerToolsContext
) -> (bool) – A context object to be used for e.g. to calculate feature expression-based values (since QGIS 3.38)
- Returns:
True
in case of success,False
if the operation failed/was abortedfeature: A pointer to the feature
- setVectorLayerTools(self, tools: QgsVectorLayerTools | None)[source]¶
Set the vector layer tools that will be used to interact with the data
- Parameters:
tools (Optional[QgsVectorLayerTools])