Class: QgsAnnotationLineItem

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

Added in version 3.16.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnnotationLineItem

Base classes

QgsAnnotationItem

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

Constructor

__init__

Abstract Methods

clone

Methods

geometry

Returns the geometry of the item.

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.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsAnnotationLineItem. See the FAQ for more details.

transientEditResultsV2

Static Methods

create

Creates a new linestring annotation item.

class qgis.core.QgsAnnotationLineItem[source]

Bases: QgsAnnotationItem

__init__(curve: QgsCurve | None)

Constructor for QgsAnnotationLineItem, with the specified curve.

Parameters:

curve (QgsCurve|None)

abstract clone(self) → QgsAnnotationLineItem | None[source]
Return type:

QgsAnnotationLineItem|None

static create() → QgsAnnotationLineItem | None

Creates a new linestring annotation item.

Return type:

QgsAnnotationLineItem|None

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:

QgsCurve|None

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

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 (QgsLineSymbol|None)

symbol(self) → QgsLineSymbol | None[source]

Returns the symbol used to render the item.

See also

setSymbol()

Return type:

QgsLineSymbol|None

virtual transientEditResultsV2(self, operation: QgsAbstractAnnotationItemEditOperation | None, context: QgsAnnotationItemEditContext) → QgsAnnotationItemEditOperationTransientResults | None[source]
Parameters:
Return type:

QgsAnnotationItemEditOperationTransientResults|None