Class: QgsAbstractLayoutUndoCommand¶
Base class for commands to undo/redo layout and layout object changes.
Class Hierarchy¶
Base classes¶
Methods
Returns the after state for the layout.  | 
|
Returns the before state for the layout.  | 
|
Returns   | 
|
Restores the state of the object from the specified stateDoc.  | 
|
Saves current layout state as after state.  | 
|
Saves current layout state as before state.  | 
|
Saves the state of the object to the specified stateDoc.  | 
|
Manually sets the after state for the command.  | 
- class qgis.core.QgsAbstractLayoutUndoCommand[source]¶
 Bases:
QUndoCommand- __init__(text: str | None, id: int = 0, parent: QUndoCommand | None = None)
 Constructor for
QgsLayoutUndoCommand. Theidargument can be used to specify an id number for the source event - this is used to determine whether QUndoCommand command compression can apply to the command.- Parameters:
 text (Optional[str])
id (int = 0)
parent (Optional[QUndoCommand] = None)
- afterState(self) QDomDocument[source]¶
 Returns the after state for the layout.
See also
See also
- Return type:
 QDomDocument
- beforeState(self) QDomDocument[source]¶
 Returns the before state for the layout.
See also
See also
- Return type:
 QDomDocument
- containsChange(self) bool[source]¶
 Returns
Trueif both the before and after states are valid and different.- Return type:
 bool
- restoreState(self, stateDoc: QDomDocument)[source]¶
 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
- Parameters:
 stateDoc (QDomDocument)