Class: QgsVectorLayerUndoPassthroughCommand

Undo command for vector layer in a transaction group mode.

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLayerUndoPassthroughCommand

Base classes

QgsVectorLayerUndoCommand

Base class for undo commands within a QgsVectorLayerEditBuffer.

QUndoCommand

Subclasses

QgsVectorLayerUndoPassthroughCommandAddAttribute

Undo command for adding attri to a vector layer in transaction group.

QgsVectorLayerUndoPassthroughCommandAddFeatures

Undo command for adding a feature to a vector layer in a transaction group mode.

QgsVectorLayerUndoPassthroughCommandChangeAttribute

Undo command for changing attr value from a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandChangeAttributes

Undo command for changing attributes’ values from a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandChangeGeometry

Undo command for changing feature geometry from a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandDeleteAttribute

Undo command for deleting attributes of a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandDeleteFeatures

Undo command for deleting features from a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandRenameAttribute

Undo command for deleting attributes of a vector layer in a transaction group.

QgsVectorLayerUndoPassthroughCommandUpdate

Undo command for running a specific sql query in a transaction group.

class qgis.core.QgsVectorLayerUndoPassthroughCommand[source]

Bases: QgsVectorLayerUndoCommand

__init__(buffer: QgsVectorLayerEditBuffer | None, text: str | None, autocreate: bool = True)

Constructor for QgsVectorLayerUndoPassthroughCommand

Parameters:
  • buffer (Optional[QgsVectorLayerEditBuffer]) – associated edit buffer

  • text (Optional[str]) – text associated with command

  • autocreate (bool = True) – flag allowing to automatically create a savepoint if necessary

errorMessage(self) str[source]

Returns the error message or an empty string if there’s none.

Return type:

str

hasError(self) bool[source]

Returns error status

Return type:

bool

rollBackToSavePoint(self) bool[source]

Rollback command, release savepoint or set error status save point must be set prior to call error satus should be False prior to call

Return type:

bool

setError(self)[source]

Set error flag and append “failed” to text

setErrorMessage(self, errorMessage: str | None)[source]

Sets the error message.

Parameters:

errorMessage (Optional[str])

setSavePoint(self, savePointId: str | None = '') bool[source]

Set the command savepoint or set error status. Error satus should be False prior to call. If the savepoint given in parameter is empty, then a new one is created if none is currently available in the transaction.

Parameters:

savePointId (Optional[str] = '')

Return type:

bool