Class: QgsAnnotationItemRegistry

class qgis.core.QgsAnnotationItemRegistry(parent: QObject = None)

Bases: PyQt5.QtCore.QObject

Creates a new empty item registry.

QgsAnnotationItemRegistry is not usually directly created, but rather accessed through QgsApplication.annotationItemRegistry().

See also

populate()

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.

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

Emitted whenever a new item type is added to the registry, with the specified type and visible name.

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

Emitted whenever a new item type is added to the registry, with the specified type and visible name. [signal]

Parameters
  • type (str) –

  • name (str) –