QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | List of all members
QgsTrackedVectorLayerTools Class Reference

#include <qgstrackedvectorlayertools.h>

Inheritance diagram for QgsTrackedVectorLayerTools:
Inheritance graph
[legend]

Public Member Functions

 QgsTrackedVectorLayerTools ()
 
bool addFeature (QgsVectorLayer *layer, const QgsAttributeMap &defaultValues, const QgsGeometry &defaultGeometry, QgsFeature *feature) const override
 This method should/will be called, whenever a new feature will be added to the layer. More...
 
void rollback ()
 Delete all features which have been added via this object. More...
 
bool saveEdits (QgsVectorLayer *layer) const override
 Should be called, when the features should be commited but the editing session is not ended. More...
 
void setVectorLayerTools (const QgsVectorLayerTools *tools)
 Set the vector layer tools that will be used to interact with the data. More...
 
bool startEditing (QgsVectorLayer *layer) const override
 This will be called, whenever a vector layer should be switched to edit mode. More...
 
bool stopEditing (QgsVectorLayer *layer, bool allowCancel) const override
 Will be called, when an editing session is ended and the features should be commited. More...
 
- Public Member Functions inherited from QgsVectorLayerTools
 QgsVectorLayerTools ()
 
virtual ~QgsVectorLayerTools ()
 

Detailed Description

Definition at line 24 of file qgstrackedvectorlayertools.h.

Constructor & Destructor Documentation

◆ QgsTrackedVectorLayerTools()

QgsTrackedVectorLayerTools::QgsTrackedVectorLayerTools ( )

Definition at line 19 of file qgstrackedvectorlayertools.cpp.

Member Function Documentation

◆ addFeature()

bool QgsTrackedVectorLayerTools::addFeature ( QgsVectorLayer layer,
const QgsAttributeMap defaultValues,
const QgsGeometry defaultGeometry,
QgsFeature feature 
) const
overridevirtual

This method should/will be called, whenever a new feature will be added to the layer.

Parameters
layerThe layer to which the feature should be added
defaultValuesDefault values for the feature to add
defaultGeometryA default geometry to add to the feature
featureUpdated feature after adding will be written back to this
Returns
True in case of success, False if the operation failed/was aborted

TODO QGIS 3: remove const qualifier

Implements QgsVectorLayerTools.

Definition at line 24 of file qgstrackedvectorlayertools.cpp.

◆ rollback()

void QgsTrackedVectorLayerTools::rollback ( )

Delete all features which have been added via this object.

Definition at line 65 of file qgstrackedvectorlayertools.cpp.

◆ saveEdits()

bool QgsTrackedVectorLayerTools::saveEdits ( QgsVectorLayer layer) const
overridevirtual

Should be called, when the features should be commited but the editing session is not ended.

Parameters
layerThe layer to commit
Returns
True if successful

TODO QGIS 3: remove const qualifier

Implements QgsVectorLayerTools.

Definition at line 55 of file qgstrackedvectorlayertools.cpp.

◆ setVectorLayerTools()

void QgsTrackedVectorLayerTools::setVectorLayerTools ( const QgsVectorLayerTools tools)

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

Definition at line 60 of file qgstrackedvectorlayertools.cpp.

◆ startEditing()

bool QgsTrackedVectorLayerTools::startEditing ( QgsVectorLayer layer) const
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.

Parameters
layerThe layer on which to start an edit session
Returns
True, if the editing session was started

TODO QGIS 3: remove const qualifier

Implements QgsVectorLayerTools.

Definition at line 45 of file qgstrackedvectorlayertools.cpp.

◆ stopEditing()

bool QgsTrackedVectorLayerTools::stopEditing ( QgsVectorLayer layer,
bool  allowCancel 
) const
overridevirtual

Will be called, when an editing session is ended and the features should be commited.

Appropriate dialogs should be shown like

Parameters
layerThe layer to commit
allowCancelTrue if a cancel button should be offered
Returns
True if successful

TODO QGIS 3: remove const qualifier

Implements QgsVectorLayerTools.

Definition at line 50 of file qgstrackedvectorlayertools.cpp.


The documentation for this class was generated from the following files: