Class: QgsTrackedVectorLayerTools

Class Hierarchy

Inheritance diagram of qgis.core.QgsTrackedVectorLayerTools

Base classes

QgsVectorLayerTools

Methods in this class are used to handle basic operations on vector layers. With an implementation of this class, parts of the application can ask for an operation to be done and the implementation will then take care of it.

QObject

Methods

addFeatureV2

This method calls the addFeature method of the backend QgsVectorLayerTools

rollback

Delete all features which have been added via this object.

setVectorLayerTools

Set the vector layer tools that will be used to interact with the data

class qgis.core.QgsTrackedVectorLayerTools[source]

Bases: QgsVectorLayerTools

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 aborted

  • feature: A pointer to the feature

rollback(self)[source]

Delete all features which have been added via this object.

setVectorLayerTools(self, tools: QgsVectorLayerTools | None)[source]

Set the vector layer tools that will be used to interact with the data

Parameters:

tools (Optional[QgsVectorLayerTools])