Class: QgsLayoutSerializableObject¶
An interface for layout objects which can be stored and read from DOM elements.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: layout()
, readXml()
, stringType()
, writeXml()
Class Hierarchy¶
Base classes¶
Interface for layout objects which support undo/redo commands. |
Subclasses¶
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. |
Abstract 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
- abstract layout(self) QgsLayout | None [source]¶
Returns the layout the object belongs to.
- Return type:
Optional[QgsLayout]
- abstract readXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool [source]¶
Sets the objects’s state from a DOM element.
element
is the DOM node corresponding to the object.See also
- Parameters:
element (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool
- abstract 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
- abstract writeXml(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool [source]¶
Stores the objects’s state in a DOM element. The
parentElement
should refer to the parent layout’s DOM element.See also
- Parameters:
parentElement (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool