Class: QgsAnnotationItemRegistry¶
- class qgis.core.QgsAnnotationItemRegistry¶
Bases:
PyQt5.QtCore.QObject
Registry of available annotation item types.
QgsAnnotationItemRegistry
is not usually directly created, but rather accessed throughQgsApplication.annotationItemRegistry()
.A companion class,
QgsAnnotationItemGuiRegistry
, handles the GUI behavior of annotation items.New in version 3.16.
QgsAnnotationItemRegistry(parent: QObject = None) Creates a new empty item registry.
QgsAnnotationItemRegistry
is not usually directly created, but rather accessed throughQgsApplication.annotationItemRegistry()
.See also
Methods
Registers a new annotation item type.
Creates a new instance of a annotation item given the item
type
.Returns the metadata for the specified item
type
.Returns a map of available item types to translated name.
Populates the registry with standard item types.
Signals
Emitted whenever a new item type is added to the registry, with the specified
type
and visiblename
.- addItemType(self, metadata: QgsAnnotationItemAbstractMetadata) bool ¶
Registers a new annotation item type. Takes ownership of the metadata instance.
- Parameters
metadata (QgsAnnotationItemAbstractMetadata) –
- Return type
bool
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createItem(self, type: str) QgsAnnotationItem ¶
Creates a new instance of a annotation item given the item
type
.- Parameters
type (str) –
- Return type
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemMetadata(self, type: str) QgsAnnotationItemAbstractMetadata ¶
Returns the metadata for the specified item
type
. ReturnsNone
if a corresponding type was not found in the registry.- Parameters
type (str) –
- Return type
- itemTypes(self) Dict[str, str] ¶
Returns a map of available item types to translated name.
- Return type
Dict[str, str]
- 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 ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶
- typeAdded¶
Emitted whenever a new item type is added to the registry, with the specified
type
and visiblename
. [signal]- Parameters
type (str) –
name (str) –