Class: QgsAnnotationLineItem

An annotation item which renders a line symbol along a line geometry.

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnnotationLineItem

Base classes

QgsAnnotationItem

Abstract base class for annotation items which are drawn with QgsAnnotationLayers.

class qgis.core.QgsAnnotationLineItem[source]

Bases: QgsAnnotationItem

__init__(curve: QgsCurve | None)

Constructor for QgsAnnotationLineItem, with the specified curve.

Parameters:

curve (Optional[QgsCurve])

static create() QgsAnnotationLineItem | None[source]

Creates a new linestring annotation item.

Return type:

Optional[QgsAnnotationLineItem]

geometry(self) QgsCurve | None[source]

Returns the geometry of the item.

The coordinate reference system for the line will be the parent layer’s QgsAnnotationLayer.crs().

See also

setGeometry()

Return type:

Optional[QgsCurve]

setGeometry(self, geometry: QgsCurve | None)[source]

Sets the geometry of the item. Ownership of geometry is transferred.

The coordinate reference system for the line will be the parent layer’s QgsAnnotationLayer.crs().

See also

geometry()

Parameters:

geometry (Optional[QgsCurve])

setSymbol(self, symbol: QgsLineSymbol | None)[source]

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also

symbol()

Parameters:

symbol (Optional[QgsLineSymbol])

symbol(self) QgsLineSymbol | None[source]

Returns the symbol used to render the item.

See also

setSymbol()

Return type:

Optional[QgsLineSymbol]