Class: QgsLayoutItemRegistry¶
- class qgis.core.QgsLayoutItemRegistry¶
Bases:
PyQt5.QtCore.QObject
Registry of available layout item types.
QgsLayoutItemRegistry
is not usually directly created, but rather accessed throughQgsApplication.layoutItemRegistry()
.A companion class,
QgsLayoutItemGuiRegistry
, handles the GUI behavior of layout items.New in version 3.0.
QgsLayoutItemRegistry(parent: QObject = None) Creates a new empty item registry.
QgsLayoutItemRegistry
is not usually directly created, but rather accessed throughQgsApplication.layoutItemRegistry()
.See also
Methods
Registers a new layout item type.
Registers a new layout multiframe type.
Creates a new instance of a layout item given the item
type
, and targetlayout
.Creates a new instance of a layout multiframe given the multiframe
type
, and targetlayout
.Returns the metadata for the specified item
type
.Returns a map of available item types to translated name.
Returns the metadata for the specified multiframe
type
.Populates the registry with standard item types.
Resolve paths in properties of a particular symbol layer.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- class ItemType¶
Bases:
int
- Layout3DMap = 65651¶
- LayoutAttributeTable = 65649¶
- LayoutElevationProfile = 65654¶
- LayoutFrame = 65647¶
- LayoutGroup = 65637¶
- LayoutHtml = 65648¶
- LayoutItem = 65636¶
- LayoutLabel = 65641¶
- LayoutLegend = 65642¶
- LayoutManualTable = 65652¶
- LayoutMap = 65639¶
- LayoutMarker = 65653¶
- LayoutPage = 65638¶
- LayoutPicture = 65640¶
- LayoutPolygon = 65644¶
- LayoutPolyline = 65645¶
- LayoutScaleBar = 65646¶
- LayoutShape = 65643¶
- LayoutTextTable = 65650¶
- PluginItem = 75650¶
- addLayoutItemType(self, metadata: QgsLayoutItemAbstractMetadata) bool ¶
Registers a new layout item type. Takes ownership of the metadata instance.
See also
- Parameters:
metadata (QgsLayoutItemAbstractMetadata) –
- Return type:
bool
- addLayoutMultiFrameType(self, metadata: QgsLayoutMultiFrameAbstractMetadata) bool ¶
Registers a new layout multiframe type. Takes ownership of the metadata instance.
See also
- Parameters:
metadata (QgsLayoutMultiFrameAbstractMetadata) –
- Return type:
bool
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createItem(self, type: int, layout: QgsLayout) QgsLayoutItem ¶
Creates a new instance of a layout item given the item
type
, and targetlayout
.See also
- Parameters:
type (int) –
layout (QgsLayout) –
- Return type:
- createMultiFrame(self, type: int, layout: QgsLayout) QgsLayoutMultiFrame ¶
Creates a new instance of a layout multiframe given the multiframe
type
, and targetlayout
.See also
- Parameters:
type (int) –
layout (QgsLayout) –
- Return type:
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemMetadata(self, type: int) QgsLayoutItemAbstractMetadata ¶
Returns the metadata for the specified item
type
. ReturnsNone
if a corresponding type was not found in the registry.See also
- Parameters:
type (int) –
- Return type:
- itemTypes(self) Dict[int, str] ¶
Returns a map of available item types to translated name.
- Return type:
Dict[int, str]
- multiFrameMetadata(self, type: int) QgsLayoutMultiFrameAbstractMetadata ¶
Returns the metadata for the specified multiframe
type
. ReturnsNone
if a corresponding type was not found in the registry.See also
- Parameters:
type (int) –
- Return type:
- multiFrameTypeAdded¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- populate(self) bool ¶
Populates the registry with standard item types. If called on a non-empty registry then this will have no effect and will return
False
.- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- resolvePaths(self, type: int, properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)¶
Resolve paths in properties of a particular symbol layer. This normally means converting relative paths to absolute paths when loading and converting absolute paths to relative paths when saving.
- Parameters:
type (int) –
properties (Dict[str) –
pathResolver (QgsPathResolver) –
saving (bool) –
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶
- typeAdded¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL