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.

Methods

boundingBox

Returns the bounding box of the item’s geographic location, in the parent layer’s coordinate reference system.

clone

Returns a clone of the item.

readXml

Reads the item’s state from the given DOM element.

render

Renders the item to the specified render context.

setZIndex

Sets the item’s z index, which controls the order in which annotation items are rendered in the layer.

type

Returns a unique (untranslated) string identifying the type of item.

writeXml

Writes the item’s state into an XML element.

zIndex

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

QgsRectangle

clone(self)QgsAnnotationItem

Returns a clone of the item. Ownership is transferred to the caller.

Return type

QgsAnnotationItem

readXml(self, element: QDomElement, context: QgsReadWriteContext)bool

Reads the item’s state from the given DOM element.

Parameters
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
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

zIndex()

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
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

setZIndex()

Return type

int