Subgroup: Annotation

Class: QgsAnnotationManager

class qgis.core.QgsAnnotationManager

Bases: PyQt5.QtCore.QObject

New in version 3.0: Manages storage of a set of QgsAnnotation annotation objects.

QgsAnnotationManager handles the storage, serializing and deserializing of QgsAnnotations. Usually this class is not constructed directly, but rather accessed through a QgsProject via QgsProject.annotationManager()

QgsAnnotationManager retains ownership of all the annotations contained in the manager.

Methods

addAnnotation Adds an annotation to the manager.
annotations Returns a list of all annotations contained in the manager.
blockSignals
childEvent
children
clear Removes and deletes all annotations from the manager.
cloneAnnotations Returns a list containing clones of all annotations contained in the manager.
connectNotify
customEvent
deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
metaObject
moveToThread
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
readXml Reads the manager’s state from a DOM element, restoring all annotations present in the XML document.
receivers
removeAnnotation Removes an annotation from the manager.
removeEventFilter
sender
senderSignalIndex
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr
writeXml Returns a DOM element representing the state of the manager.

Attributes

annotationAboutToBeRemoved Emitted when an annotation is about to be removed from the manager [signal]
annotationAdded Emitted when a annotation has been added to the manager [signal]
annotationRemoved Emitted when an annotation was removed from the manager [signal]
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
addAnnotation(self, annotation: QgsAnnotation) → bool

Adds an annotation to the manager. Ownership of the annotation is transferred to the manager. Returns true if the addition was successful, or false if the annotation could not be added.

annotationAboutToBeRemoved

Emitted when an annotation is about to be removed from the manager [signal]

annotationAdded

Emitted when a annotation has been added to the manager [signal]

annotationRemoved

Emitted when an annotation was removed from the manager [signal]

annotations(self) → List[QgsAnnotation]

Returns a list of all annotations contained in the manager.

childEvent()
clear(self)

Removes and deletes all annotations from the manager.

cloneAnnotations(self) → List[QgsAnnotation]

Returns a list containing clones of all annotations contained in the manager. The caller takes responsibility for deleting all returned annotations.

See also

annotations()

connectNotify()
customEvent()
disconnectNotify()
isSignalConnected()
readXml(self, element: QDomElement, context: QgsReadWriteContext) → bool

Reads the manager’s state from a DOM element, restoring all annotations present in the XML document.

See also

writeXml()

receivers()
removeAnnotation(self, annotation: QgsAnnotation) → bool

Removes an annotation from the manager. The annotation is deleted. Returns true if the removal was successful, or false if the removal failed (eg as a result of removing an annotation which is not contained in the manager).

See also

addAnnotation()

See also

compositionRemoved()

See also

compositionAboutToBeRemoved()

See also

clear()

sender()
senderSignalIndex()
timerEvent()
writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement

Returns a DOM element representing the state of the manager.

See also

readXml()