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¶
- 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]
- populate(self) bool[source]¶
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
- signal typeAdded[source]¶
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.