QGIS API Documentation
2.8.2-Wien
|
#include <qgsvectorlayereditbuffer.h>
Signals | |
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. |
Public Member Functions | |
QgsVectorLayerEditBuffer (QgsVectorLayer *layer) | |
~QgsVectorLayerEditBuffer () | |
virtual bool | addAttribute (const QgsField &field) |
add an attribute field (but does not commit it) returns true if the field was added | |
const QList< QgsField > & | addedAttributes () |
added attributes fields which are not commited | |
const QgsFeatureMap & | addedFeatures () |
New features which are not commited. | |
virtual bool | addFeature (QgsFeature &f) |
Adds a feature. | |
virtual bool | addFeatures (QgsFeatureList &features) |
Insert a copy of the given features into the layer (but does not commit it) | |
virtual bool | changeAttributeValue (QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant()) |
changed an attribute value (but does not commit it) | |
const QgsChangedAttributesMap & | changedAttributeValues () |
Changed attributes values which are not commited. | |
const QgsGeometryMap & | changedGeometries () |
Changed geometries which are not commited. | |
virtual bool | changeGeometry (QgsFeatureId fid, QgsGeometry *geom) |
change feature's geometry | |
virtual bool | commitChanges (QStringList &commitErrors) |
Attempts to commit any changes to disk. | |
virtual bool | deleteAttribute (int attr) |
delete an attribute field (but does not commit it) | |
const QgsAttributeList & | deletedAttributeIds () |
deleted attributes fields which are not commited. | |
const QgsFeatureIds | deletedFeatureIds () |
virtual bool | deleteFeature (QgsFeatureId fid) |
delete a feature from the layer (but does not commit it) | |
virtual bool | isModified () const |
Returns true if the provider has been modified since the last commit. | |
virtual void | rollBack () |
Stop editing and discard the edits. |
Protected Slots | |
void | undoIndexChanged (int index) |
Protected Member Functions | |
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 | |
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 33 of file qgsvectorlayereditbuffer.h.
QgsVectorLayerEditBuffer::QgsVectorLayerEditBuffer | ( | QgsVectorLayer * | layer | ) |
Definition at line 38 of file qgsvectorlayereditbuffer.cpp.
QgsVectorLayerEditBuffer::~QgsVectorLayerEditBuffer | ( | ) |
Definition at line 44 of file qgsvectorlayereditbuffer.cpp.
|
inlineprotected |
Definition at line 134 of file qgsvectorlayereditbuffer.h.
|
virtual |
add an attribute field (but does not commit it) returns true if the field was added
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 207 of file qgsvectorlayereditbuffer.cpp.
|
inline |
added attributes fields which are not commited
Definition at line 102 of file qgsvectorlayereditbuffer.h.
|
inline |
New features which are not commited.
Definition at line 93 of file qgsvectorlayereditbuffer.h.
|
virtual |
Adds a feature.
f | feature to add |
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 110 of file qgsvectorlayereditbuffer.cpp.
|
virtual |
Insert a copy of the given features into the layer (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 126 of file qgsvectorlayereditbuffer.cpp.
|
signal |
|
signal |
|
signal |
|
virtual |
changed an attribute value (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 186 of file qgsvectorlayereditbuffer.cpp.
|
inline |
Changed attributes values which are not commited.
Definition at line 96 of file qgsvectorlayereditbuffer.h.
|
inline |
Changed geometries which are not commited.
Definition at line 105 of file qgsvectorlayereditbuffer.h.
|
virtual |
change feature's geometry
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 163 of file qgsvectorlayereditbuffer.cpp.
|
virtual |
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 in QgsVectorLayerEditPassthrough.
Definition at line 253 of file qgsvectorlayereditbuffer.cpp.
|
signal |
|
signal |
Signals emitted after committing changes.
|
signal |
|
signal |
|
signal |
|
signal |
|
virtual |
delete an attribute field (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 230 of file qgsvectorlayereditbuffer.cpp.
|
inline |
deleted attributes fields which are not commited.
The list is kept sorted.
Definition at line 99 of file qgsvectorlayereditbuffer.h.
|
inline |
Definition at line 107 of file qgsvectorlayereditbuffer.h.
|
virtual |
delete a feature from the layer (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 142 of file qgsvectorlayereditbuffer.cpp.
|
signal |
|
signal |
|
signal |
|
protected |
update added and changed features after addition of an attribute
Definition at line 570 of file qgsvectorlayereditbuffer.cpp.
|
protected |
update added and changed features after removal of an attribute
Definition at line 587 of file qgsvectorlayereditbuffer.cpp.
|
virtual |
Returns true if the provider has been modified since the last commit.
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 49 of file qgsvectorlayereditbuffer.cpp.
|
signal |
This signal is emitted when modifications has been done on layer.
|
virtual |
Stop editing and discard the edits.
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 537 of file qgsvectorlayereditbuffer.cpp.
|
protectedslot |
Definition at line 55 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Updates an index in an attribute map to a new value (for updates of changed attributes)
Definition at line 612 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Update feature with uncommited attribute updates.
Definition at line 85 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Update feature with uncommited geometry updates.
Definition at line 78 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Definition at line 63 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Definition at line 625 of file qgsvectorlayereditbuffer.cpp.
|
friend |
Definition at line 158 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 160 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 165 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 161 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 164 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 163 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 166 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 162 of file qgsvectorlayereditbuffer.h.
|
protected |
Definition at line 157 of file qgsvectorlayereditbuffer.h.
|
protected |
added attributes fields which are not commited
Definition at line 184 of file qgsvectorlayereditbuffer.h.
|
protected |
New features which are not commited.
Definition at line 175 of file qgsvectorlayereditbuffer.h.
|
protected |
Changed attributes values which are not commited.
Definition at line 178 of file qgsvectorlayereditbuffer.h.
|
protected |
Changed geometries which are not commited.
Definition at line 187 of file qgsvectorlayereditbuffer.h.
|
protected |
deleted attributes fields which are not commited.
The list is kept sorted.
Definition at line 181 of file qgsvectorlayereditbuffer.h.
|
protected |
Deleted feature IDs which are not commited.
Note a feature can be added and then deleted again before the change is committed - in that case the added feature would be removed from mAddedFeatures only and not entered here.
Definition at line 172 of file qgsvectorlayereditbuffer.h.