Class: QgsAnnotationPointTextItem¶
An annotation item which renders a text string at a point location.
Added in version 3.16.
Class Hierarchy¶
Base classes¶
Abstract base class for annotation items which are drawn with |
Methods
Returns the text's alignment relative to the reference |
|
Returns the text's rotation angle, in degrees clockwise. |
|
Returns the text format used to render the text. |
|
Returns the point location of the text. |
|
Returns the rotation mode for the text item. |
|
Sets the text's alignment relative to the reference |
|
Sets the text's rotation angle, in degrees clockwise. |
|
Sets the text format used to render the text. |
|
Sets the point location of the text. |
|
Sets the rotation mode for the text item. |
|
Sets the text rendered by the item. |
|
Returns the text rendered by the item. |
Static Methods
Creates a new text at point annotation item. |
- class qgis.core.QgsAnnotationPointTextItem[source]¶
Bases:
QgsAnnotationItem- __init__(text: str | None, point: QgsPointXY)
Constructor for QgsAnnotationPointTextItem, containing the specified
textat the specifiedpoint.- Parameters:
text (Optional[str])
point (QgsPointXY)
- alignment(self) Qt.Alignment[source]¶
Returns the text’s alignment relative to the reference
point().See also
- Return type:
Qt.Alignment
- angle(self) float[source]¶
Returns the text’s rotation angle, in degrees clockwise.
See also
- Return type:
float
- static create() QgsAnnotationPointTextItem | None[source]¶
Creates a new text at point annotation item.
- Return type:
Optional[QgsAnnotationPointTextItem]
- format(self) QgsTextFormat[source]¶
Returns the text format used to render the text.
See also
- Return type:
- point(self) QgsPointXY[source]¶
Returns the point location of the text.
The coordinate reference system for the point will be the parent layer’s
QgsAnnotationLayer.crs().See also
- Return type:
- rotationMode(self) Qgis.SymbolRotationMode[source]¶
Returns the rotation mode for the text item.
See also
Added in version 3.32.
- Return type:
- setAlignment(self, alignment: Qt.Alignment | Qt.AlignmentFlag)[source]¶
Sets the text’s
alignmentrelative to the referencepoint().See also
- Parameters:
alignment (Union[Qt.Alignment, Qt.AlignmentFlag])
- setAngle(self, angle: float)[source]¶
Sets the text’s rotation
angle, in degrees clockwise.See also
- Parameters:
angle (float)
- setFormat(self, format: QgsTextFormat)[source]¶
Sets the text
formatused to render the text.See also
- Parameters:
format (QgsTextFormat)
- setPoint(self, point: QgsPointXY)[source]¶
Sets the
pointlocation of the text.The coordinate reference system for the point will be the parent layer’s
QgsAnnotationLayer.crs().See also
- Parameters:
point (QgsPointXY)
- setRotationMode(self, mode: Qgis.SymbolRotationMode)[source]¶
Sets the rotation
modefor the text item.See also
Added in version 3.32.
- Parameters:
mode (Qgis.SymbolRotationMode)