Class: QgsLayoutSerializableObject¶
An interface for layout objects which can be stored and read from DOM elements.
Class Hierarchy¶
Base classes¶
Interface for layout objects which support undo/redo commands.  | 
Subclasses¶
Class used to render   | 
|
Contains settings relating to the appearance, spacing and offset for layout grids.  | 
|
Stores and manages the snap guides used by a layout.  | 
|
A manager for a collection of pages in a layout.  | 
|
Manages snapping grids and preset snap lines in a layout, and handles snapping points to the nearest grid coordinate/snap line when possible.  | 
Methods
Returns the layout the object belongs to.  | 
|
Sets the objects's state from a DOM element.  | 
|
Returns the object type as a string.  | 
|
Stores the objects's state in a DOM element.  | 
- class qgis.core.QgsLayoutSerializableObject[source]¶
 Bases:
QgsLayoutUndoObjectInterface- layout(self) QgsLayout | None[source]¶
 Returns the layout the object belongs to.
- Return type:
 Optional[QgsLayout]
- readXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]¶
 Sets the objects’s state from a DOM element.
elementis the DOM node corresponding to the object.See also
- Parameters:
 element (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
 bool
- stringType(self) str[source]¶
 Returns the object type as a string.
This string must be a unique, single word, character only representation of the item type, eg “LayoutScaleBar”
- Return type:
 str
- writeXml(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]¶
 Stores the objects’s state in a DOM element. The
parentElementshould refer to the parent layout’s DOM element.See also
- Parameters:
 parentElement (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
 bool