QGIS API Documentation
2.14.0-Essen
|
#include <qgsvectorlayereditbuffer.h>
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. More... | |
const QList< QgsField > & | addedAttributes () |
Added attributes fields which are not commited. More... | |
const QgsFeatureMap & | addedFeatures () |
New features which are not commited. More... | |
virtual bool | addFeature (QgsFeature &f) |
Adds a feature. More... | |
virtual bool | addFeatures (QgsFeatureList &features) |
Insert a copy of the given features into the layer (but does not commit it) More... | |
virtual bool | changeAttributeValue (QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant()) |
Changed an attribute value (but does not commit it) More... | |
const QgsChangedAttributesMap & | changedAttributeValues () |
Changed attributes values which are not commited. More... | |
const QgsGeometryMap & | changedGeometries () |
Changed geometries which are not commited. More... | |
virtual bool | changeGeometry (QgsFeatureId fid, QgsGeometry *geom) |
Change feature's geometry. More... | |
virtual bool | commitChanges (QStringList &commitErrors) |
Attempts to commit any changes to disk. More... | |
virtual bool | deleteAttribute (int attr) |
Delete an attribute field (but does not commit it) More... | |
const QgsAttributeList & | deletedAttributeIds () |
Deleted attributes fields which are not commited. More... | |
const QgsFeatureIds | deletedFeatureIds () |
virtual bool | deleteFeature (QgsFeatureId fid) |
Delete a feature from the layer (but does not commit it) More... | |
virtual bool | deleteFeatures (const QgsFeatureIds &fid) |
Deletes a set of features from the layer (but does not commit it) More... | |
virtual bool | isModified () const |
Returns true if the provider has been modified since the last commit. More... | |
virtual void | rollBack () |
Stop editing and discard the edits. More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Slots | |
void | undoIndexChanged (int index) |
Protected Member Functions | |
QgsVectorLayerEditBuffer () | |
void | handleAttributeAdded (int index) |
Update added and changed features after addition of an attribute. More... | |
void | handleAttributeDeleted (int index) |
Update added and changed features after removal of an attribute. More... | |
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) More... | |
void | updateChangedAttributes (QgsFeature &f) |
Update feature with uncommited attribute updates. More... | |
void | updateFeatureGeometry (QgsFeature &f) |
Update feature with uncommited geometry updates. More... | |
void | updateFields (QgsFields &fields) |
void | updateLayerFields () |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
QgsVectorLayer * | L |
QList< QgsField > | mAddedAttributes |
Added attributes fields which are not commited. More... | |
QgsFeatureMap | mAddedFeatures |
New features which are not commited. More... | |
QgsChangedAttributesMap | mChangedAttributeValues |
Changed attributes values which are not commited. More... | |
QgsGeometryMap | mChangedGeometries |
Changed geometries which are not commited. More... | |
QgsAttributeList | mDeletedAttributeIds |
Deleted attributes fields which are not commited. More... | |
QgsFeatureIds | mDeletedFeatureIds |
Deleted feature IDs which are not commited. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
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 137 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 220 of file qgsvectorlayereditbuffer.cpp.
Added attributes fields which are not commited.
Definition at line 105 of file qgsvectorlayereditbuffer.h.
|
inline |
New features which are not commited.
Definition at line 96 of file qgsvectorlayereditbuffer.h.
|
virtual |
Adds a feature.
f | feature to add |
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 112 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 128 of file qgsvectorlayereditbuffer.cpp.
|
signal |
|
signal |
|
signal |
|
virtual |
Changed an attribute value (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 198 of file qgsvectorlayereditbuffer.cpp.
|
inline |
Changed attributes values which are not commited.
Definition at line 99 of file qgsvectorlayereditbuffer.h.
|
inline |
Changed geometries which are not commited.
Definition at line 108 of file qgsvectorlayereditbuffer.h.
|
virtual |
Change feature's geometry.
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 176 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 266 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 243 of file qgsvectorlayereditbuffer.cpp.
|
inline |
Deleted attributes fields which are not commited.
The list is kept sorted.
Definition at line 102 of file qgsvectorlayereditbuffer.h.
|
inline |
Definition at line 110 of file qgsvectorlayereditbuffer.h.
|
virtual |
Delete a feature from the layer (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 144 of file qgsvectorlayereditbuffer.cpp.
|
virtual |
Deletes a set of features from the layer (but does not commit it)
Reimplemented in QgsVectorLayerEditPassthrough.
Definition at line 164 of file qgsvectorlayereditbuffer.cpp.
|
signal |
|
signal |
|
signal |
|
protected |
Update added and changed features after addition of an attribute.
Definition at line 607 of file qgsvectorlayereditbuffer.cpp.
|
protected |
Update added and changed features after removal of an attribute.
Definition at line 626 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 574 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 653 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 666 of file qgsvectorlayereditbuffer.cpp.
|
friend |
Definition at line 161 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 163 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 168 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 164 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 167 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 166 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 169 of file qgsvectorlayereditbuffer.h.
|
friend |
Definition at line 165 of file qgsvectorlayereditbuffer.h.
|
protected |
Definition at line 160 of file qgsvectorlayereditbuffer.h.
Added attributes fields which are not commited.
Definition at line 187 of file qgsvectorlayereditbuffer.h.
|
protected |
New features which are not commited.
Definition at line 178 of file qgsvectorlayereditbuffer.h.
|
protected |
Changed attributes values which are not commited.
Definition at line 181 of file qgsvectorlayereditbuffer.h.
|
protected |
Changed geometries which are not commited.
Definition at line 190 of file qgsvectorlayereditbuffer.h.
|
protected |
Deleted attributes fields which are not commited.
The list is kept sorted.
Definition at line 184 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 175 of file qgsvectorlayereditbuffer.h.