QGIS API Documentation
2.8.2-Wien
|
Methods in this class are used to handle basic operations on vector layers. More...
#include <qgsvectorlayertools.h>
Public Member Functions | |
QgsVectorLayerTools () | |
virtual | ~QgsVectorLayerTools () |
virtual bool | addFeature (QgsVectorLayer *layer, QgsAttributeMap defaultValues=QgsAttributeMap(), const QgsGeometry &defaultGeometry=QgsGeometry()) const =0 |
This method should/will be called, whenever a new feature will be added to the layer. | |
virtual bool | saveEdits (QgsVectorLayer *layer) const =0 |
Should be called, when the features should be commited but the editing session is not ended. | |
virtual bool | startEditing (QgsVectorLayer *layer) const =0 |
This will be called, whenever a vector layer should be switched to edit mode. | |
virtual bool | stopEditing (QgsVectorLayer *layer, bool allowCancel=true) const =0 |
Will be called, when an editing session is ended and the features should be commited. |
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.
Reimplement this class, if you need to have custom checks or GUI elements in your application.
Definition at line 33 of file qgsvectorlayertools.h.
|
inline |
Definition at line 36 of file qgsvectorlayertools.h.
|
inlinevirtual |
Definition at line 39 of file qgsvectorlayertools.h.
|
pure virtual |
This method should/will be called, whenever a new feature will be added to the layer.
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 |
|
pure virtual |
Should be called, when the features should be commited but the editing session is not ended.
layer | The layer to commit |
|
pure virtual |
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 |
|
pure virtual |
Will be called, when an editing session is ended and the features should be commited.
Appropriate dialogs should be shown like
layer | The layer to commit |
allowCancel | True if a cancel button should be offered |