QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
55 f = features.at( features.count() - 1 );
friend class QgsVectorLayerUndoPassthroughCommandRenameAttribute
friend class QgsVectorLayerUndoPassthroughCommandDeleteAttribute
bool deleteAttribute(int attr) override
Delete an attribute field (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 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)
friend class QgsVectorLayerUndoPassthroughCommandChangeGeometry
QgsFeatureList features() const
List of features (added feaures can be modified by default values from database)
Undo command for vector layer in transaction group mode.
void layerModified()
Emitted when modifications has been done on layer.
bool hasError() const
Returns error status.
friend class QgsVectorLayerUndoPassthroughCommandChangeAttribute
bool addAttribute(const QgsField &field) override
Add an attribute field (but does not commit it) returns true if the field was added.
bool deleteFeatures(const QgsFeatureIds &fids) override
Deletes a set of features from the layer (but does not commit it)
Undo command for adding a feature to a vector layer in transaction group mode.
friend class QgsVectorLayerUndoPassthroughCommandAddAttribute
QgsVectorLayerEditPassthrough(QgsVectorLayer *layer)
QList< QgsFeature > QgsFeatureList
QMap< int, QVariant > QgsAttributeMap
bool update(QgsTransaction *transaction, const QString &sql, const QString &name)
Update underlying data with a SQL query embedded in a transaction.
void rollBack() override
Stop editing and discard the edits.
bool changeAttributeValues(QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues) override
Changes values of attributes (but does not commit it).
friend class QgsVectorLayerUndoPassthroughCommandUpdate
QSet< QgsFeatureId > QgsFeatureIds
bool renameAttribute(int attr, const QString &newName) override
Renames an attribute field (but does not commit it)
bool isModified() const override
Returns true if the provider has been modified since the last commit.
QUndoStack * undoStack()
Returns pointer to layer's undo stack.
bool deleteFeature(QgsFeatureId fid) override
Delete a feature from the layer (but does not commit it)
friend class QgsVectorLayerUndoPassthroughCommandAddFeatures
bool changeGeometry(QgsFeatureId fid, const QgsGeometry &geom) override
Change feature's geometry.
friend class QgsVectorLayerUndoPassthroughCommandChangeAttributes
friend class QgsVectorLayerUndoPassthroughCommandDeleteFeatures
bool commitChanges(QStringList &commitErrors) override
Attempts to commit any changes to disk.