Class: QgsAnnotationPolygonItem¶
-
class
qgis.core.
QgsAnnotationPolygonItem
(polygon: QgsCurvePolygon)¶ Bases:
QgsAnnotationItem
Constructor for
QgsAnnotationPolygonItem
, with the specifiedpolygon
geometry.An annotation item which renders a fill symbol for a polygon geometry.
New in version 3.16.
- Parameters
polygon –
-
boundingBox
(self) → QgsRectangle¶ - Return type
-
clone
(self) → QgsAnnotationPolygonItem¶ - Return type
-
create
() → QgsAnnotationPolygonItem¶ Creates a new polygon annotation item.
- Return type
-
geometry
(self) → QgsCurvePolygon¶ Returns the geometry of the item.
The coordinate reference system for the polygon will be the parent layer’s
QgsAnnotationLayer.crs()
.See also
- Return type
-
readXml
(self, element: QDomElement, context: QgsReadWriteContext) → bool¶ - Parameters
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type
bool
-
render
(self, context: QgsRenderContext, feedback: QgsFeedback)¶ - Parameters
context (QgsRenderContext) –
feedback (QgsFeedback) –
-
setGeometry
(self, geometry: QgsCurvePolygon)¶ Sets the
geometry
of the item.The coordinate reference system for the polygon will be the parent layer’s
QgsAnnotationLayer.crs()
.See also
- Parameters
geometry (QgsCurvePolygon) –
-
setSymbol
(self, symbol: QgsFillSymbol)¶ Sets the
symbol
used to render the polygon item.The item takes ownership of the symbol.
See also
- Parameters
symbol (QgsFillSymbol) –
-
symbol
(self) → QgsFillSymbol¶ Returns the symbol used to render the item.
See also
- Return type
-
type
(self) → str¶ - Return type
str
-
writeXml
(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶ - Parameters
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
bool