Class: QgsLayoutUndoObjectInterface

Interface for layout objects which support undo/redo commands.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutUndoObjectInterface

Subclasses

QgsLayout

Base class for layouts, which can contain items such as maps, labels, scalebars, etc.

QgsLayoutSerializableObject

An interface for layout objects which can be stored and read from DOM elements.

QgsLayoutItem

Base class for graphical items within a QgsLayout.

QgsLayoutMultiFrame

Abstract base class for layout items with the ability to distribute the content to several frames (QgsLayoutFrame items).

Methods

createCommand

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

class qgis.core.QgsLayoutUndoObjectInterface[source]

Bases: object

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

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]