Subgroup: Layout

Class: QgsLayoutItemGuiRegistry

class qgis.gui.QgsLayoutItemGuiRegistry(parent: QObject = None)

Bases: PyQt5.QtCore.QObject

Creates a new empty item GUI registry.

QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through QgsGui.layoutItemGuiRegistry()

See also

populate()

Registry of available layout item GUI behavior.

QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through QgsGui.layoutItemGuiRegistry()

This acts as a companion to QgsLayoutItemRegistry, handling only the components related to the GUI behavior of layout items.

New in version 3.0: Methods

addItemGroup Registers a new item group with the registry.
addLayoutItemGuiMetadata Registers the gui metadata for a new layout item type.
childEvent
connectNotify
createItem Creates a new instance of a layout item given the item metadata metadataId, target layout.
createItemWidget Creates a new instance of a layout item configuration widget for the specified item.
customEvent
disconnectNotify
isSignalConnected
itemGroup Returns a reference to the item group with matching id.
itemMetadata Returns the metadata for the specified item metadataId.
itemMetadataIds Returns a list of available item metadata ids handled by the registry.
newItemAddedToLayout Called when a newly created item of the associated metadata metadataId has been added to a layout.
receivers
sender
senderSignalIndex
timerEvent

Signals

typeAdded Emitted whenever a new item type is added to the registry, with the specified metadataId.

Attributes

addItemGroup(self, group: QgsLayoutItemGuiGroup) → bool

Registers a new item group with the registry. This must be done before calling addLayoutItemGuiMetadata() for any item types associated with the group.

Returns true if group was added, or false if group could not be added (e.g. due to duplicate id value).

See also

itemGroup()

addLayoutItemGuiMetadata(self, metadata: QgsLayoutItemAbstractGuiMetadata) → bool

Registers the gui metadata for a new layout item type. Takes ownership of the metadata instance.

childEvent()
connectNotify()
createItem(self, metadataId: int, layout: QgsLayout) → QgsLayoutItem

Creates a new instance of a layout item given the item metadata metadataId, target layout.

createItemWidget(self, item: QgsLayoutItem) → QgsLayoutItemBaseWidget

Creates a new instance of a layout item configuration widget for the specified item.

customEvent()
disconnectNotify()
isSignalConnected()
itemGroup(self, id: str) → QgsLayoutItemGuiGroup

Returns a reference to the item group with matching id.

See also

addItemGroup()

itemMetadata(self, metadataId: int) → QgsLayoutItemAbstractGuiMetadata

Returns the metadata for the specified item metadataId. Returns None if a corresponding metadataId was not found in the registry.

itemMetadataIds(self) → List[int]

Returns a list of available item metadata ids handled by the registry.

newItemAddedToLayout(self, metadataId: int, item: QgsLayoutItem)

Called when a newly created item of the associated metadata metadataId has been added to a layout.

This is only called for additions which result from GUI operations - i.e. it is not called for items added from templates.

receivers()
sender()
senderSignalIndex()
timerEvent()
typeAdded

Emitted whenever a new item type is added to the registry, with the specified metadataId. [signal]