QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
15 #ifndef QGSVECTORLAYEREDITBUFFER_H
16 #define QGSVECTORLAYEREDITBUFFER_H
18 #include "qgis_core.h"
44 virtual bool isModified()
const;
66 virtual bool changeAttributeValue(
QgsFeatureId fid,
int field,
const QVariant &newValue,
const QVariant &oldValue = QVariant() );
82 virtual bool deleteAttribute(
int attr );
90 virtual bool renameAttribute(
int attr,
const QString &newName );
107 virtual bool commitChanges( QStringList &commitErrors );
110 virtual void rollBack();
217 void undoIndexChanged(
int index );
221 void layerModified();
233 void attributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant & );
234 void attributeAdded(
int idx );
235 void attributeDeleted(
int idx );
243 void attributeRenamed(
int idx,
const QString &newName );
246 void committedAttributesDeleted(
const QString &layerId,
const QgsAttributeList &deletedAttributes );
247 void committedAttributesAdded(
const QString &layerId,
const QList<QgsField> &addedAttributes );
255 void committedAttributesRenamed(
const QString &layerId,
const QgsFieldNameMap &renamedAttributes );
256 void committedFeaturesAdded(
const QString &layerId,
const QgsFeatureList &addedFeatures );
257 void committedFeaturesRemoved(
const QString &layerId,
const QgsFeatureIds &deletedFeatureIds );
258 void committedAttributeValuesChanges(
const QString &layerId,
const QgsChangedAttributesMap &changedAttributesValues );
259 void committedGeometriesChanges(
const QString &layerId,
const QgsGeometryMap &changedGeometries );
270 void updateChangedAttributes(
QgsFeature &f );
273 void handleAttributeAdded(
int index );
276 void handleAttributeDeleted(
int index );
279 void updateAttributeMapIndex(
QgsAttributeMap &attrs,
int index,
int offset )
const;
281 void updateLayerFields();
333 friend class QgsGrassProvider;
344 bool commitChangesCheckGeometryTypeCompatibility( QStringList &commitErrors );
352 bool commitChangesDeleteAttributes(
bool &attributesDeleted, QStringList &commitErrors );
360 bool commitChangesRenameAttributes(
bool &attributesRenamed, QStringList &commitErrors );
368 bool commitChangesAddAttributes(
bool &attributesAdded, QStringList &commitErrors );
376 bool commitChangesCheckAttributesModifications(
const QgsFields oldFields, QStringList &commitErrors );
384 bool commitChangesChangeAttributes(
bool &attributesChanged, QStringList &commitErrors );
392 bool commitChangesDeleteFeatures(
bool &featuresDeleted, QStringList &commitErrors );
400 bool commitChangesAddFeatures(
bool &featuresAdded, QStringList &commitErrors );
403 #endif // QGSVECTORLAYEREDITBUFFER_H
bool isFeatureAttributesChanged(QgsFeatureId id) const
Returns true if the specified feature ID has had an attribute changed but not committed.
QSet< int > QgsAttributeIds
Undo command for renaming an existing attribute of a vector layer.
QList< QgsField > mAddedAttributes
Added attributes fields which are not committed.
Undo command for adding a new attribute to a vector layer.
QgsFeatureIds mDeletedFeatureIds
Deleted feature IDs which are not committed.
Undo command for changing attributes' values from a vector layer in transaction group.
The edit buffer group manages a group of edit buffers.
Container of fields for a vector layer.
QgsAttributeList mDeletedAttributeIds
Deleted attributes fields which are not committed. The list is kept sorted.
bool isFeatureDeleted(QgsFeatureId id) const
Returns true if the specified feature ID has been deleted but not committed.
Undo command for adding a feature to a vector layer.
Undo command for changing feature geometry from a vector layer in transaction group.
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
bool isAttributeDeleted(int index) const
Returns true if the specified attribute has been deleted but not committed.
Undo command for vector layer in transaction group mode.
QList< int > QgsAttributeList
Undo command for adding attri to a vector layer in transaction group.
bool isFeatureGeometryChanged(QgsFeatureId id) const
Returns true if the specified feature ID has had its geometry changed but not committed.
QgsFeatureMap mAddedFeatures
New features which are not committed.
Undo command for adding a feature to a vector layer in transaction group mode.
QgsAttributeList deletedAttributeIds() const
Returns a list of deleted attributes fields which are not committed.
QgsChangedAttributesMap changedAttributeValues() const
Returns a map of features with changed attributes values which are not committed.
QList< QgsFeature > QgsFeatureList
QMap< int, QVariant > QgsAttributeMap
Undo command for deleting features from a vector layer in transaction group.
Undo command for modifying the geometry of a feature from a vector layer.
Undo command for deleting attri of a vector layer in transaction group.
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
Undo command for removing an existing attribute from a vector layer.
QSet< QgsFeatureId > QgsFeatureIds
QgsFeatureIds deletedFeatureIds() const
Returns a list of deleted feature IDs which are not committed.
Base class for undo commands within a QgsVectorLayerEditBuffer.
bool isFeatureAdded(QgsFeatureId id) const
Returns true if the specified feature ID has been added but not committed.
QgsFieldNameMap mRenamedAttributes
Renamed attributes which are not committed.
A geometry is the spatial representation of a feature.
Undo command for deleting a feature from a vector layer.
Represents a vector layer which manages a vector based data sets.
Undo command for running a specific sql query in transaction group.
QgsGeometryMap changedGeometries() const
Returns a map of features with changed geometries which are not committed.
QMap< int, QString > QgsFieldNameMap
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QgsGeometryMap mChangedGeometries
Changed geometries which are not committed.
Undo command for deleting attri of a vector layer in transaction group.
QList< QgsField > addedAttributes() const
Returns a list of added attributes fields which are not committed.
Undo command for modifying an attribute of a feature from a vector layer.
Undo command for changing attr value from a vector layer in transaction group.
QgsFeatureMap addedFeatures() const
Returns a map of new features which are not committed.
QgsChangedAttributesMap mChangedAttributeValues
Changed attributes values which are not committed.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Encapsulate a field in an attribute table or data source.