Class: QgsAnnotationLineItem¶
- class qgis.core.QgsAnnotationLineItem¶
Bases:
QgsAnnotationItem
An annotation item which renders a line symbol along a line geometry.
Added in version 3.16.
QgsAnnotationLineItem(curve: Optional[QgsCurve]) Constructor for
QgsAnnotationLineItem
, with the specifiedcurve
.Methods
- param operation:
- rtype:
QgsRectangle
- rtype:
Optional[QgsAnnotationLineItem]
Copies common properties from the base class from an
other
item.Creates a new linestring 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 marker 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 | None) Qgis.AnnotationItemEditOperationResult ¶
- Parameters:
operation (Optional[QgsAbstractAnnotationItemEditOperation])
- Return type:
- boundingBox(self) QgsRectangle ¶
- Return type:
- clone(self) QgsAnnotationLineItem | None ¶
- Return type:
Optional[QgsAnnotationLineItem]
- copyCommonProperties(self, other: QgsAnnotationItem | None)¶
Copies common properties from the base class from an
other
item.Added in version 3.22.
- create() QgsAnnotationLineItem | None ¶
Creates a new linestring annotation item.
- Return type:
Optional[QgsAnnotationLineItem]
- geometry(self) QgsCurve | None ¶
Returns the geometry of the item.
The coordinate reference system for the line will be the parent layer’s
QgsAnnotationLayer.crs()
.See also
- Return type:
Optional[QgsCurve]
- 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
Added 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 | None)¶
- Parameters:
context (QgsRenderContext)
feedback (Optional[QgsFeedback])
- setGeometry(self, geometry: QgsCurve | None)¶
Sets the
geometry
of the item. Ownership ofgeometry
is transferred.The coordinate reference system for the line will be the parent layer’s
QgsAnnotationLayer.crs()
.See also
- Parameters:
geometry (Optional[QgsCurve])
- setSymbol(self, symbol: QgsLineSymbol | None)¶
Sets the
symbol
used to render the marker item.The item takes ownership of the symbol.
See also
- Parameters:
symbol (Optional[QgsLineSymbol])
- symbol(self) QgsLineSymbol | None ¶
Returns the symbol used to render the item.
See also
- Return type:
Optional[QgsLineSymbol]
- transientEditResults(self, operation: QgsAbstractAnnotationItemEditOperation | None) QgsAnnotationItemEditOperationTransientResults | None ¶
- Parameters:
operation (Optional[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
Added in version 3.22.
- writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
- Parameters:
element (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool