Class: QgsAnnotationPointTextItem¶
-
class
qgis.core.
QgsAnnotationPointTextItem
(text: str, point: QgsPointXY)¶ Bases:
QgsAnnotationItem
Constructor for
QgsAnnotationPointTextItem
, containing the specifiedtext
at the specifiedpoint
.An annotation item which renders a text string at a point location.
New in version 3.16.
- Parameters
text (str) –
point –
-
alignment
(self) → Qt.Alignment¶ Returns the text’s alignment relative to the reference
point()
.See also
- Return type
Qt.Alignment
-
angle
(self) → float¶ Returns the text’s rotation angle, in degrees clockwise.
See also
- Return type
float
-
boundingBox
(self) → QgsRectangle¶ - Return type
-
clone
(self) → QgsAnnotationPointTextItem¶ - Return type
-
create
() → QgsAnnotationPointTextItem¶ Creates a new text at point annotation item.
- Return type
-
format
(self) → QgsTextFormat¶ Returns the text format used to render the text.
See also
- Return type
-
point
(self) → QgsPointXY¶ 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
-
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) –
-
setAlignment
(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag])¶ Sets the text’s
alignment
relative to the referencepoint()
.See also
- Parameters
alignment (Union[Qt.Alignment) –
-
setAngle
(self, angle: float)¶ Sets the text’s rotation
angle
, in degrees clockwise.See also
- Parameters
angle (float) –
-
setFormat
(self, format: QgsTextFormat)¶ Sets the text
format
used to render the text.See also
- Parameters
format (QgsTextFormat) –
-
setPoint
(self, point: QgsPointXY)¶ Sets the
point
location of the text.The coordinate reference system for the point will be the parent layer’s
QgsAnnotationLayer.crs()
.See also
- Parameters
point (QgsPointXY) –
-
setText
(self, text: str)¶ Sets the
text
rendered by the item.See also
- Parameters
text (str) –
-
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