Class: QgsLayoutUndoObjectInterface

class qgis.core.QgsLayoutUndoObjectInterface

Bases: sip.wrapper

Interface for layout objects which support undo/redo commands.

Added in version 3.0:

Methods

createCommand

Creates a new layout undo command with the specified text and parent.

createCommand(self, text: str | None, id: int = 0, parent: QUndoCommand | None = None) QgsAbstractLayoutUndoCommand | None

Creates a new layout undo command with the specified text and parent.

The id argument 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)

Return type:

Optional[QgsAbstractLayoutUndoCommand]