Class: QgsAnnotationItemRegistry¶
Registry of available annotation item types.
QgsAnnotationItemRegistry is not usually directly created,
but rather accessed through
QgsApplication.annotationItemRegistry().
A companion class, QgsAnnotationItemGuiRegistry, handles the
GUI behavior of annotation items.
Added in version 3.16.
Class Hierarchy¶
Base classes¶
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 visible name.  | 
- class qgis.core.QgsAnnotationItemRegistry[source]¶
 Bases:
QObject- __init__(parent: QObject | None = None)
 Creates a new empty item registry.
QgsAnnotationItemRegistry is not usually directly created, but rather accessed through
QgsApplication.annotationItemRegistry().See also
- Parameters:
 parent (Optional[QObject] = None)
- addItemType(self, metadata: QgsAnnotationItemAbstractMetadata | None) bool[source]¶
 Registers a new annotation item type. Takes ownership of the metadata instance.
- Parameters:
 metadata (Optional[QgsAnnotationItemAbstractMetadata])
- Return type:
 bool
- createItem(self, type: str | None) QgsAnnotationItem | None[source]¶
 Creates a new instance of a annotation item given the item
type.- Parameters:
 type (Optional[str])
- Return type:
 Optional[QgsAnnotationItem]
- itemMetadata(self, type: str | None) QgsAnnotationItemAbstractMetadata | None[source]¶
 Returns the metadata for the specified item
type. ReturnsNoneif a corresponding type was not found in the registry.- Parameters:
 type (Optional[str])
- Return type:
 Optional[QgsAnnotationItemAbstractMetadata]
- itemTypes(self) Dict[str, str]¶
 Returns a map of available item types to translated name.
- Return type:
 Dict[str, str]