Class: QgsAnnotationManager¶
-
class
qgis.core.
QgsAnnotationManager
(project: QgsProject = None)¶ Bases:
PyQt5.QtCore.QObject
Constructor for
QgsAnnotationManager
. The project will become the parent object for this manager.Manages storage of a set of
QgsAnnotation
annotation objects.QgsAnnotationManager
handles the storage, serializing and deserializing ofQgsAnnotations
. Usually this class is not constructed directly, but rather accessed through aQgsProject
viaQgsProject.annotationManager()
QgsAnnotationManager
retains ownership of all the annotations contained in the manager.New in version 3.0.
- Parameters
project –
-
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.
See also
See also
- Parameters
annotation (QgsAnnotation) –
- Return type
bool
-
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.
See also
- Return type
List[QgsAnnotation]
-
childEvent
()¶
-
clear
(self)¶ Removes and deletes all annotations from the manager.
See also
-
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
- Return type
List[QgsAnnotation]
-
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
- Parameters
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type
bool
-
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
See also
See also
See also
- Parameters
annotation (QgsAnnotation) –
- Return type
bool
-
sender
()¶
-
senderSignalIndex
()¶
-
timerEvent
()¶
-
writeXml
(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement¶ Returns a DOM element representing the state of the manager.
See also
- Parameters
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
QDomElement