Class: QgsAnnotationPolygonItem¶
- class qgis.core.QgsAnnotationPolygonItem¶
Bases:
QgsAnnotationItem
An annotation item which renders a fill symbol for a polygon geometry.
New in version 3.16.
QgsAnnotationPolygonItem(polygon:
QgsCurvePolygon
) Constructor forQgsAnnotationPolygonItem
, with the specifiedpolygon
geometry.Methods
- param operation:
- rtype:
QgsRectangle
- rtype:
QgsAnnotationPolygonItem
Copies common properties from the base class from an
other
item.Creates a new polygon annotation item.
Returns the geometry of the item.
- rtype:
List[QgsAnnotationItemNode]
Reads common properties from the base class from the given DOM
element
.- param element:
- param context:
Sets the
geometry
of the item.Sets the
symbol
used to render the polygon item.Returns the symbol used to render the item.
- param operation:
- rtype:
str
Writes common properties from the base class into an XML
element
.- param element:
- applyEdit(self, operation: QgsAbstractAnnotationItemEditOperation) Qgis.AnnotationItemEditOperationResult ¶
- Parameters:
operation (QgsAbstractAnnotationItemEditOperation) –
- Return type:
- boundingBox(self) QgsRectangle ¶
- Return type:
- clone(self) QgsAnnotationPolygonItem ¶
- Return type:
- copyCommonProperties(self, other: QgsAnnotationItem)¶
Copies common properties from the base class from an
other
item.New in version 3.22.
- 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:
- nodes(self) List[QgsAnnotationItemNode] ¶
- Return type:
List[QgsAnnotationItemNode]
- readCommonProperties(self, element: QDomElement, context: QgsReadWriteContext) bool ¶
Reads common properties from the base class from the given DOM
element
.See also
New in version 3.22.
- 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:
- transientEditResults(self, operation: QgsAbstractAnnotationItemEditOperation) QgsAnnotationItemEditOperationTransientResults ¶
- Parameters:
operation (QgsAbstractAnnotationItemEditOperation) –
- Return type:
- type(self) str ¶
- Return type:
str
- writeCommonProperties(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Writes common properties from the base class into an XML
element
.See also
New in version 3.22.
- writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool