Class: QgsAnnotationPointTextItem¶
- class qgis.core.QgsAnnotationPointTextItem¶
Bases:
QgsAnnotationItem
An annotation item which renders a text string at a point location.
New in version 3.16.
QgsAnnotationPointTextItem(text: str, point:
QgsPointXY
) Constructor forQgsAnnotationPointTextItem
, containing the specifiedtext
at the specifiedpoint
.Methods
Returns the text's alignment relative to the reference
point()
.Returns the text's rotation angle, in degrees clockwise.
- param operation:
- rtype:
QgsRectangle
- rtype:
QgsAnnotationPointTextItem
Copies common properties from the base class from an
other
item.Creates a new text at point annotation item.
- rtype:
Qgis.AnnotationItemFlags
Returns the text format used to render the text.
- rtype:
List[QgsAnnotationItemNode]
Returns the point location of the text.
Reads common properties from the base class from the given DOM
element
.- param element:
- param context:
Returns the rotation mode for the text item.
Sets the text's
alignment
relative to the referencepoint()
.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.
- param operation:
- rtype:
str
Writes common properties from the base class into an XML
element
.- param element:
- 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
- applyEdit(self, operation: QgsAbstractAnnotationItemEditOperation) Qgis.AnnotationItemEditOperationResult ¶
- Parameters:
operation (QgsAbstractAnnotationItemEditOperation) –
- Return type:
- boundingBox(self) QgsRectangle ¶
- boundingBox(self, context: QgsRenderContext) QgsRectangle
- Return type:
- clone(self) QgsAnnotationPointTextItem ¶
- Return type:
- copyCommonProperties(self, other: QgsAnnotationItem)¶
Copies common properties from the base class from an
other
item.New in version 3.22.
- create() QgsAnnotationPointTextItem ¶
Creates a new text at point annotation item.
- Return type:
- flags(self) Qgis.AnnotationItemFlags ¶
- Return type:
- format(self) QgsTextFormat ¶
Returns the text format used to render the text.
See also
- Return type:
- nodes(self) List[QgsAnnotationItemNode] ¶
- Return type:
List[QgsAnnotationItemNode]
- 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:
- 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) –
- rotationMode(self) Qgis.SymbolRotationMode ¶
Returns the rotation mode for the text item.
See also
New in version 3.32.
- Return type:
- setAlignment(self, alignment: 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) –
- setRotationMode(self, mode: Qgis.SymbolRotationMode)¶
Sets the rotation
mode
for the text item.See also
New in version 3.32.
- Parameters:
mode (Qgis.SymbolRotationMode) –
- setText(self, text: str)¶
Sets the
text
rendered by the item.See also
- Parameters:
text (str) –
- 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