Subgroup: Abstract

Class: QgsAbstractLayoutUndoCommand

class qgis.core.QgsAbstractLayoutUndoCommand

Bases: PyQt5.QtWidgets.QUndoCommand

Base class for commands to undo/redo layout and layout object changes.

New in version 3.0: Methods

actionText
afterState Returns the after state for the layout.
beforeState Returns the before state for the layout.
child
childCount
containsChange Returns true if both the before and after states are valid and different.
id
isObsolete
mergeWith
redo
restoreState Restores the state of the object from the specified stateDoc.
saveAfterState Saves current layout state as after state.
saveBeforeState Saves current layout state as before state.
saveState Saves the state of the object to the specified stateDoc.
setAfterState Manually sets the after state for the command.
setObsolete
setText
text
undo

Attributes

afterState(self) → QDomDocument

Returns the after state for the layout.

See also

saveAfterState()

See also

beforeState()

beforeState(self) → QDomDocument

Returns the before state for the layout.

See also

afterState()

containsChange(self) → bool

Returns true if both the before and after states are valid and different.

id(self) → int
redo(self)
restoreState(self, stateDoc: QDomDocument)

Restores the state of the object from the specified stateDoc.

Subclasses must implement this to handle restoring their current state from the encapsulated state.

See also

saveState()

saveAfterState(self)

Saves current layout state as after state.

See also

afterState()

saveBeforeState(self)

Saves current layout state as before state.

See also

beforeState()

See also

saveAfterState()

saveState(self, stateDoc: QDomDocument)

Saves the state of the object to the specified stateDoc.

Subclasses must implement this to handle encapsulating their current state into a DOM document.

See also

restoreState()

setAfterState(self, stateDoc: QDomDocument)

Manually sets the after state for the command. Generally this should not be called directly.

undo(self)