Class: QgsTextAnnotation

An annotation item that displays formatted text from a QTextDocument document.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsTextAnnotation

Base classes

QgsAnnotation

Abstract base class for annotation items which are drawn over a map.

QObject

Constructor

__init__

Abstract Methods

clone

Methods

document

Returns the text document which will be rendered within the annotation.

setDocument

Sets the text document which will be rendered within the annotation.

Static Methods

create

Returns a new QgsTextAnnotation object.

class qgis.core.QgsTextAnnotation[source]

Bases: QgsAnnotation

__init__(parent: QObject | None = None)

Constructor for QgsTextAnnotation.

Parameters:

parent (QObject|None = None)

abstract clone(self) → QgsTextAnnotation | None[source]
Return type:

QgsTextAnnotation|None

static create() → QgsTextAnnotation | None[source]

Returns a new QgsTextAnnotation object.

Return type:

QgsTextAnnotation|None

document(self) → QTextDocument | None[source]

Returns the text document which will be rendered within the annotation.

See also

setDocument()

Return type:

QTextDocument|None

setDocument(self, doc: QTextDocument | None)[source]

Sets the text document which will be rendered within the annotation. Ownership is not transferred.

See also

document()

Parameters:

doc (QTextDocument|None)