Class: QgsAnnotationPolygonItem

An annotation item which renders a fill symbol for a polygon geometry.

Added in version 3.16.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnnotationPolygonItem

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 polygon 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 QgsAnnotationPolygonItem. See the FAQ for more details.

transientEditResultsV2

Static Methods

create

Creates a new polygon annotation item.

class qgis.core.QgsAnnotationPolygonItem[source]

Bases: QgsAnnotationItem

__init__(polygon: QgsCurvePolygon | None)

Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry.

Parameters:

polygon (QgsCurvePolygon|None)

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

QgsAnnotationPolygonItem|None

static create() → QgsAnnotationPolygonItem | None

Creates a new polygon annotation item.

Return type:

QgsAnnotationPolygonItem|None

geometry(self) → QgsCurvePolygon | None[source]

Returns the geometry of the item.

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

See also

setGeometry()

Return type:

QgsCurvePolygon|None

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

Sets the geometry of the item.

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

See also

geometry()

Parameters:

geometry (QgsCurvePolygon|None)

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

Sets the symbol used to render the polygon item.

The item takes ownership of the symbol.

See also

symbol()

Parameters:

symbol (QgsFillSymbol|None)

symbol(self) → QgsFillSymbol | None[source]

Returns the symbol used to render the item.

See also

setSymbol()

Return type:

QgsFillSymbol|None

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

QgsAnnotationItemEditOperationTransientResults|None