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 through QgsApplication.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 through QgsApplication.annotationItemRegistry().

See also

populate()

Methods

addItemType

Registers a new annotation item type.

childEvent

connectNotify

createItem

Creates a new instance of a annotation item given the item type.

customEvent

disconnectNotify

isSignalConnected

itemMetadata

Returns the metadata for the specified item type.

itemTypes

Returns a map of available item types to translated name.

populate

Populates the registry with standard item types.

receivers

sender

senderSignalIndex

timerEvent

Signals

typeAdded

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

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:

QgsAnnotationItem

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
itemMetadata(self, type: str) QgsAnnotationItemAbstractMetadata

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

Parameters:

type (str) –

Return type:

QgsAnnotationItemAbstractMetadata

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

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