Class: QgsAnnotationItem¶
- class qgis.core.QgsAnnotationItem¶
Bases:
sip.wrapper
Constructor for an annotation item.
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
New in version 3.16:
Methods
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Returns a clone of the item.
Reads the item's state from the given DOM
element
.Renders the item to the specified render
context
.Sets the item's z
index
, which controls the order in which annotation items are rendered in the layer.Returns a unique (untranslated) string identifying the type of item.
Writes the item's state into an XML
element
.Returns the item's z index, which controls the order in which annotation items are rendered in the layer.
- boundingBox(self) QgsRectangle ¶
Returns the bounding box of the item’s geographic location, in the parent layer’s coordinate reference system.
- Return type
- clone(self) QgsAnnotationItem ¶
Returns a clone of the item. Ownership is transferred to the caller.
- Return type
- readXml(self, element: QDomElement, context: QgsReadWriteContext) bool ¶
Reads the item’s state from the given DOM
element
.- Parameters
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type
bool
- render(self, context: QgsRenderContext, feedback: QgsFeedback)¶
Renders the item to the specified render
context
.The
feedback
argument can be used to detect render cancellations during expensive render operations.- Parameters
context (QgsRenderContext) –
feedback (QgsFeedback) –
- setZIndex(self, index: int)¶
Sets the item’s z
index
, which controls the order in which annotation items are rendered in the layer.See also
- Parameters
index (int) –
- type(self) str ¶
Returns a unique (untranslated) string identifying the type of item.
- Return type
str
- writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Writes the item’s state into an XML
element
.- Parameters
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
bool
- zIndex(self) int ¶
Returns the item’s z index, which controls the order in which annotation items are rendered in the layer.
See also
- Return type
int