QGIS API Documentation
2.8.2-Wien
|
#include <qgsvectorlayereditpassthrough.h>
Public Member Functions | |
QgsVectorLayerEditPassthrough (QgsVectorLayer *layer) | |
bool | addAttribute (const QgsField &field) override |
add an attribute field (but does not commit it) returns true if the field was added | |
bool | addFeature (QgsFeature &f) override |
Adds a feature. | |
bool | addFeatures (QgsFeatureList &features) override |
Insert a copy of the given features into the layer (but does not commit it) | |
bool | changeAttributeValue (QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant()) override |
changed an attribute value (but does not commit it) | |
bool | changeGeometry (QgsFeatureId fid, QgsGeometry *geom) override |
change feature's geometry | |
bool | commitChanges (QStringList &commitErrors) override |
Attempts to commit any changes to disk. | |
bool | deleteAttribute (int attr) override |
delete an attribute field (but does not commit it) | |
bool | deleteFeature (QgsFeatureId fid) override |
delete a feature from the layer (but does not commit it) | |
bool | isModified () const override |
Returns true if the provider has been modified since the last commit. | |
void | rollBack () override |
Stop editing and discard the edits. | |
Public Member Functions inherited from QgsVectorLayerEditBuffer | |
QgsVectorLayerEditBuffer (QgsVectorLayer *layer) | |
~QgsVectorLayerEditBuffer () | |
const QList< QgsField > & | addedAttributes () |
added attributes fields which are not commited | |
const QgsFeatureMap & | addedFeatures () |
New features which are not commited. | |
const QgsChangedAttributesMap & | changedAttributeValues () |
Changed attributes values which are not commited. | |
const QgsGeometryMap & | changedGeometries () |
Changed geometries which are not commited. | |
const QgsAttributeList & | deletedAttributeIds () |
deleted attributes fields which are not commited. | |
const QgsFeatureIds | deletedFeatureIds () |
Additional Inherited Members | |
Signals inherited from QgsVectorLayerEditBuffer | |
void | attributeAdded (int idx) |
void | attributeDeleted (int idx) |
void | attributeValueChanged (QgsFeatureId fid, int idx, const QVariant &) |
void | committedAttributesAdded (const QString &layerId, const QList< QgsField > &addedAttributes) |
void | committedAttributesDeleted (const QString &layerId, const QgsAttributeList &deletedAttributes) |
Signals emitted after committing changes. | |
void | committedAttributeValuesChanges (const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues) |
void | committedFeaturesAdded (const QString &layerId, const QgsFeatureList &addedFeatures) |
void | committedFeaturesRemoved (const QString &layerId, const QgsFeatureIds &deletedFeatureIds) |
void | committedGeometriesChanges (const QString &layerId, const QgsGeometryMap &changedGeometries) |
void | featureAdded (QgsFeatureId fid) |
void | featureDeleted (QgsFeatureId fid) |
void | geometryChanged (QgsFeatureId fid, QgsGeometry &geom) |
void | layerModified () |
This signal is emitted when modifications has been done on layer. | |
Protected Slots inherited from QgsVectorLayerEditBuffer | |
void | undoIndexChanged (int index) |
Protected Member Functions inherited from QgsVectorLayerEditBuffer | |
QgsVectorLayerEditBuffer () | |
void | handleAttributeAdded (int index) |
update added and changed features after addition of an attribute | |
void | handleAttributeDeleted (int index) |
update added and changed features after removal of an attribute | |
void | updateAttributeMapIndex (QgsAttributeMap &attrs, int index, int offset) const |
Updates an index in an attribute map to a new value (for updates of changed attributes) | |
void | updateChangedAttributes (QgsFeature &f) |
Update feature with uncommited attribute updates. | |
void | updateFeatureGeometry (QgsFeature &f) |
Update feature with uncommited geometry updates. | |
void | updateFields (QgsFields &fields) |
void | updateLayerFields () |
Protected Attributes inherited from QgsVectorLayerEditBuffer | |
QgsVectorLayer * | L |
QList< QgsField > | mAddedAttributes |
added attributes fields which are not commited | |
QgsFeatureMap | mAddedFeatures |
New features which are not commited. | |
QgsChangedAttributesMap | mChangedAttributeValues |
Changed attributes values which are not commited. | |
QgsGeometryMap | mChangedGeometries |
Changed geometries which are not commited. | |
QgsAttributeList | mDeletedAttributeIds |
deleted attributes fields which are not commited. | |
QgsFeatureIds | mDeletedFeatureIds |
Deleted feature IDs which are not commited. |
Definition at line 22 of file qgsvectorlayereditpassthrough.h.
|
inline |
Definition at line 26 of file qgsvectorlayereditpassthrough.h.
|
overridevirtual |
add an attribute field (but does not commit it) returns true if the field was added
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 80 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
Adds a feature.
f | feature to add |
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 20 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
Insert a copy of the given features into the layer (but does not commit it)
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 31 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
changed an attribute value (but does not commit it)
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 66 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
change feature's geometry
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 54 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
Attempts to commit any changes to disk.
Returns the result of the attempt. If a commit fails, the in-memory changes are left alone.
This allows editing to continue if the commit failed on e.g. a disallowed value in a Postgres database - the user can re-edit and try again.
The commits occur in distinct stages, (add attributes, add features, change attribute values, change geometries, delete features, delete attributes) so if a stage fails, it's difficult to roll back cleanly. Therefore any error message also includes which stage failed so that the user has some chance of repairing the damage cleanly.
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 100 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
delete an attribute field (but does not commit it)
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 90 of file qgsvectorlayereditpassthrough.cpp.
|
overridevirtual |
delete a feature from the layer (but does not commit it)
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 44 of file qgsvectorlayereditpassthrough.cpp.
|
inlineoverridevirtual |
Returns true if the provider has been modified since the last commit.
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 27 of file qgsvectorlayereditpassthrough.h.
|
overridevirtual |
Stop editing and discard the edits.
Reimplemented from QgsVectorLayerEditBuffer.
Definition at line 105 of file qgsvectorlayereditpassthrough.cpp.