|
QGIS API Documentation 3.99.0-Master (f78f5286a64)
|
Vector layer tools subclass which "tracks" edits. More...
#include <qgstrackedvectorlayertools.h>

Public Member Functions | |
| QgsTrackedVectorLayerTools ()=default | |
| bool | addFeatureV2 (QgsVectorLayer *layer, const QgsAttributeMap &defaultValues, const QgsGeometry &defaultGeometry, QgsFeature *feature, const QgsVectorLayerToolsContext &context) const override |
| This method calls the addFeature method of the backend QgsVectorLayerTools. | |
| bool | copyMoveFeatures (QgsVectorLayer *layer, QgsFeatureRequest &request, double dx=0, double dy=0, QString *errorMsg=nullptr, const bool topologicalEditing=false, QgsVectorLayer *topologicalLayer=nullptr, QString *childrenInfoMsg=nullptr) const override |
| Copy and move features with defined translation. | |
| void | rollback () |
| Delete all features which have been added via this object. | |
| bool | saveEdits (QgsVectorLayer *layer) const override |
| Should be called, when the features should be committed but the editing session is not ended. | |
| void | setVectorLayerTools (const QgsVectorLayerTools *tools) |
| Set the vector layer tools that will be used to interact with the data. | |
| bool | startEditing (QgsVectorLayer *layer) const override |
| This will be called, whenever a vector layer should be switched to edit mode. | |
| bool | stopEditing (QgsVectorLayer *layer, bool allowCancel) const override |
| Will be called, when an editing session is ended and the features should be committed. | |
Public Member Functions inherited from QgsVectorLayerTools | |
| QgsVectorLayerTools () | |
| virtual bool | addFeature (QgsVectorLayer *layer, const QgsAttributeMap &defaultValues=QgsAttributeMap(), const QgsGeometry &defaultGeometry=QgsGeometry(), QgsFeature *feature=nullptr, QWidget *parentWidget=nullptr, bool showModal=true, bool hideParent=false) const |
| This method should/will be called, whenever a new feature will be added to the layer. | |
| bool | forceSuppressFormPopup () const |
| Returns force suppress form popup status. | |
| QgsProject * | project () const |
| Returns the project to be used by operations when needed. | |
| void | setForceSuppressFormPopup (bool forceSuppressFormPopup) |
| Sets force suppress form popup status to forceSuppressFormPopup. | |
| void | setProject (QgsProject *project) |
| Sets the project to be used by operations when needed. | |
Vector layer tools subclass which "tracks" edits.
Definition at line 28 of file qgstrackedvectorlayertools.h.
|
default |
|
overridevirtual |
This method calls the addFeature method of the backend QgsVectorLayerTools.
| layer | The layer to which the feature should be added |
| defaultValues | Default values for the feature to add |
| defaultGeometry | A default geometry to add to the feature |
| feature | A pointer to the feature |
| context | A context object to be used for e.g. to calculate feature expression-based values (since QGIS 3.38) |
true in case of success, false if the operation failed/was aborted Reimplemented from QgsVectorLayerTools.
Definition at line 23 of file qgstrackedvectorlayertools.cpp.
|
overridevirtual |
Copy and move features with defined translation.
| layer | The layer |
| request | The request for the features to be moved. It will be assigned to a new feature request with the newly copied features. |
| dx | The translation on x |
| dy | The translation on y |
| errorMsg | If given, it will contain the error message |
| topologicalEditing | If true, the function will perform topological editing of the vertices of layer on layer and topologicalLayer |
| topologicalLayer | The layer where vertices from the moved features of layer will be added |
| childrenInfoMsg | If given, it will contain messages related to the creation of child features |
true if all features could be copied. Reimplemented from QgsVectorLayerTools.
Definition at line 60 of file qgstrackedvectorlayertools.cpp.
| void QgsTrackedVectorLayerTools::rollback | ( | ) |
Delete all features which have been added via this object.
Definition at line 70 of file qgstrackedvectorlayertools.cpp.
|
overridevirtual |
Should be called, when the features should be committed but the editing session is not ended.
| layer | The layer to commit |
true if successful Implements QgsVectorLayerTools.
Definition at line 55 of file qgstrackedvectorlayertools.cpp.
| void QgsTrackedVectorLayerTools::setVectorLayerTools | ( | const QgsVectorLayerTools * | tools | ) |
Set the vector layer tools that will be used to interact with the data.
Definition at line 65 of file qgstrackedvectorlayertools.cpp.
|
overridevirtual |
This will be called, whenever a vector layer should be switched to edit mode.
Check the providers capability to edit in here. If successful layer->startEditing() will be called and true returned.
| layer | The layer on which to start an edit session |
true, if the editing session was started Implements QgsVectorLayerTools.
Definition at line 45 of file qgstrackedvectorlayertools.cpp.
|
overridevirtual |
Will be called, when an editing session is ended and the features should be committed.
Appropriate dialogs should be shown like
| layer | The layer to commit |
| allowCancel | true if a cancel button should be offered |
true if successful Implements QgsVectorLayerTools.
Definition at line 50 of file qgstrackedvectorlayertools.cpp.