QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
QgsVectorLayerEditPassthrough Class Reference

#include <qgsvectorlayereditpassthrough.h>

Inheritance diagram for QgsVectorLayerEditPassthrough:
Inheritance graph
[legend]

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 QgsFeatureMapaddedFeatures ()
 New features which are not commited.
const QgsChangedAttributesMapchangedAttributeValues ()
 Changed attributes values which are not commited.
const QgsGeometryMapchangedGeometries ()
 Changed geometries which are not commited.
const QgsAttributeListdeletedAttributeIds ()
 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
QgsVectorLayerL
QList< QgsFieldmAddedAttributes
 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.

Detailed Description

Definition at line 22 of file qgsvectorlayereditpassthrough.h.

Constructor & Destructor Documentation

QgsVectorLayerEditPassthrough::QgsVectorLayerEditPassthrough ( QgsVectorLayer layer)
inline

Definition at line 26 of file qgsvectorlayereditpassthrough.h.

Member Function Documentation

bool QgsVectorLayerEditPassthrough::addAttribute ( const QgsField field)
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.

bool QgsVectorLayerEditPassthrough::addFeature ( QgsFeature f)
overridevirtual

Adds a feature.

Parameters
ffeature to add
Returns
True in case of success and False in case of error

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 20 of file qgsvectorlayereditpassthrough.cpp.

bool QgsVectorLayerEditPassthrough::addFeatures ( QgsFeatureList features)
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.

bool QgsVectorLayerEditPassthrough::changeAttributeValue ( QgsFeatureId  fid,
int  field,
const QVariant &  newValue,
const QVariant &  oldValue = QVariant() 
)
overridevirtual

changed an attribute value (but does not commit it)

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 66 of file qgsvectorlayereditpassthrough.cpp.

bool QgsVectorLayerEditPassthrough::changeGeometry ( QgsFeatureId  fid,
QgsGeometry geom 
)
overridevirtual

change feature's geometry

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 54 of file qgsvectorlayereditpassthrough.cpp.

bool QgsVectorLayerEditPassthrough::commitChanges ( QStringList &  commitErrors)
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.

bool QgsVectorLayerEditPassthrough::deleteAttribute ( int  attr)
overridevirtual

delete an attribute field (but does not commit it)

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 90 of file qgsvectorlayereditpassthrough.cpp.

bool QgsVectorLayerEditPassthrough::deleteFeature ( QgsFeatureId  fid)
overridevirtual

delete a feature from the layer (but does not commit it)

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 44 of file qgsvectorlayereditpassthrough.cpp.

bool QgsVectorLayerEditPassthrough::isModified ( ) const
inlineoverridevirtual

Returns true if the provider has been modified since the last commit.

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 27 of file qgsvectorlayereditpassthrough.h.

void QgsVectorLayerEditPassthrough::rollBack ( )
overridevirtual

Stop editing and discard the edits.

Reimplemented from QgsVectorLayerEditBuffer.

Definition at line 105 of file qgsvectorlayereditpassthrough.cpp.


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