Class: QgsAnnotationLineItem

class qgis.core.QgsAnnotationLineItem

Bases: QgsAnnotationItem

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

New in version 3.16.

QgsAnnotationLineItem(curve: QgsCurve) Constructor for QgsAnnotationLineItem, with the specified linestring.

Methods

boundingBox

rtype

QgsRectangle

clone

rtype

QgsAnnotationLineItem

create

Creates a new linestring annotation item.

geometry

Returns the geometry of the item.

readXml

param element

render

param context

setGeometry

Sets the geometry of the item.

setSymbol

Sets the symbol used to render the marker item.

symbol

Returns the symbol used to render the item.

type

rtype

str

writeXml

param element

boundingBox(self)QgsRectangle
Return type

QgsRectangle

clone(self)QgsAnnotationLineItem
Return type

QgsAnnotationLineItem

create()QgsAnnotationLineItem

Creates a new linestring annotation item.

Return type

QgsAnnotationLineItem

geometry(self)QgsCurve

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

QgsCurve

readXml(self, element: QDomElement, context: QgsReadWriteContext)bool
Parameters
Return type

bool

render(self, context: QgsRenderContext, feedback: QgsFeedback)
Parameters
setGeometry(self, geometry: QgsCurve)

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 (QgsCurve) –

setSymbol(self, symbol: QgsLineSymbol)

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also

symbol()

Parameters

symbol (QgsLineSymbol) –

symbol(self)QgsLineSymbol

Returns the symbol used to render the item.

See also

setSymbol()

Return type

QgsLineSymbol

type(self)str
Return type

str

writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext)bool
Parameters
Return type

bool