Class: QgsLayoutItemAbstractMetadata

class qgis.core.QgsLayoutItemAbstractMetadata(type: int, visibleName: str, visiblePluralName: str = '')

Bases: sip.wrapper

Constructor for QgsLayoutItemAbstractMetadata with the specified class type and visibleName.

The optional visiblePluralName argument can be used to specify a plural variant of the item type.

QgsLayoutItemAbstractMetadata(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.

New in version 3.0: Enums

Methods

createItem

Creates a layout item of this class for a specified layout.

resolvePaths

Resolve paths in the item’s properties (if there are any paths).

type

Returns the unique item type code for the layout item class.

visibleName

Returns a translated, user visible name for the layout item class.

visiblePluralName

Returns a translated, user visible name for plurals of the layout item class (e.g.

Signals

Attributes

createItem(self, layout: QgsLayout) → QgsLayoutItem

Creates a layout item of this class for a specified layout.

resolvePaths(self, properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)

Resolve paths in the item’s properties (if there are any paths). When saving is True, paths are converted from absolute to relative, when saving is False, 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.

type(self) → int

Returns the unique item type code for the layout item class.

visibleName(self) → str

Returns a translated, user visible name for the layout item class.

visiblePluralName(self) → str

Returns a translated, user visible name for plurals of the layout item class (e.g. “Labels” for a “Label” item).

New in version 3.10.