Class: QgsAnnotationPointTextItem

class qgis.core.QgsAnnotationPointTextItem(text: str, point: QgsPointXY)

Bases: QgsAnnotationItem

Constructor for QgsAnnotationPointTextItem, containing the specified text at the specified point.

An annotation item which renders a text string at a point location.

Methods

alignment

Returns the text’s alignment relative to the reference point().

angle

Returns the text’s rotation angle, in degrees clockwise.

boundingBox

rtype

QgsRectangle

clone

rtype

QgsAnnotationPointTextItem

create

Creates a new text at point annotation item.

format

Returns the text format used to render the text.

point

Returns the point location of the text.

readXml

param element

render

param context

setAlignment

Sets the text’s alignment relative to the reference point().

setAngle

Sets the text’s rotation angle, in degrees clockwise.

setFormat

Sets the text format used to render the text.

setPoint

Sets the point location of the text.

setText

Sets the text rendered by the item.

text

Returns the text rendered by the item.

type

rtype

str

writeXml

param element

alignment(self)Qt.Alignment

Returns the text’s alignment relative to the reference point().

See also

setAlignment()

Return type

Qt.Alignment

angle(self)float

Returns the text’s rotation angle, in degrees clockwise.

See also

setAngle()

Return type

float

boundingBox(self)QgsRectangle
Return type

QgsRectangle

clone(self)QgsAnnotationPointTextItem
Return type

QgsAnnotationPointTextItem

create()QgsAnnotationPointTextItem

Creates a new text at point annotation item.

Return type

QgsAnnotationPointTextItem

format(self)QgsTextFormat

Returns the text format used to render the text.

See also

setFormat()

Return type

QgsTextFormat

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

setPoint()

Return type

QgsPointXY

readXml(self, element: QDomElement, context: QgsReadWriteContext)bool
Parameters
Return type

bool

render(self, context: QgsRenderContext, feedback: QgsFeedback)
Parameters
setAlignment(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag])

Sets the text’s alignment relative to the reference point().

See also

alignment()

Parameters

alignment (Union[Qt.Alignment) –

setAngle(self, angle: float)

Sets the text’s rotation angle, in degrees clockwise.

See also

angle()

Parameters

angle (float) –

setFormat(self, format: QgsTextFormat)

Sets the text format used to render the text.

See also

format()

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

point()

Parameters

point (QgsPointXY) –

setText(self, text: str)

Sets the text rendered by the item.

See also

text()

Parameters

text (str) –

text(self)str

Returns the text rendered by the item.

See also

setText()

Return type

str

type(self)str
Return type

str

writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext)bool
Parameters
Return type

bool