Class: QgsLayoutItemAbstractMetadata¶
Stores metadata about one layout item class.
A companion class, QgsLayoutItemAbstractGuiMetadata, handles
the GUI behavior of QgsLayoutItems.
Note
In C++ you can use QgsLayoutItemMetadata convenience class.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: createItem()
Abstract Methods
Creates a layout item of this class for a specified layout. |
Methods
Returns the unique item type code for the layout item class. |
|
Returns a translated, user visible name for the layout item class. |
|
Returns a translated, user visible name for plurals of the layout item class (e.g. "Labels" for a "Label" item). |
Virtual Methods
In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsLayoutItemAbstractMetadata. See the FAQ for more details.
Resolve paths in the item's properties (if there are any paths). |
- class qgis.core.QgsLayoutItemAbstractMetadata[source]¶
Bases:
object- __init__(type: int, visibleName: str | None, visiblePluralName: str | None = '')
Constructor for QgsLayoutItemAbstractMetadata with the specified class
typeandvisibleName.The optional
visiblePluralNameargument can be used to specify a plural variant of the item type.- Parameters:
type (int)
visibleName (Optional[str])
visiblePluralName (Optional[str] = '')
- __init__(a0: QgsLayoutItemAbstractMetadata)
- Parameters:
- abstract createItem(self, layout: QgsLayout | None) QgsLayoutItem | None[source]¶
Creates a layout item of this class for a specified
layout.- Parameters:
layout (Optional[QgsLayout])
- Return type:
Optional[QgsLayoutItem]
- virtual resolvePaths(self, properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)[source]¶
Resolve paths in the item’s
properties(if there are any paths). WhensavingisTrue, paths are converted from absolute to relative, whensavingisFalse, paths are converted from relative to absolute. This ensures that paths in project files can be relative, but in item instances the paths are always absolute.- Parameters:
properties (Dict[str, Any])
pathResolver (QgsPathResolver)
saving (bool)
- type(self) int[source]¶
Returns the unique item type code for the layout item class.
- Return type:
int