Class: QgsTextAnnotation

class qgis.core.QgsTextAnnotation

Bases: QgsAnnotation

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

Added in version 3.0.

QgsTextAnnotation(parent: Optional[QObject] = None) Constructor for QgsTextAnnotation.

Methods

childEvent

clone

rtype:

Optional[QgsTextAnnotation]

connectNotify

copyCommonProperties

Copies common annotation properties to the targe annotation.

create

Returns a new QgsTextAnnotation object.

customEvent

disconnectNotify

document

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

isSignalConnected

minimumFrameSize

Returns the minimum frame size for the annotation.

readXml

param itemElem:

receivers

renderAnnotation

param context:

sender

senderSignalIndex

setDocument

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

timerEvent

writeXml

param elem:

childEvent(self, a0: QChildEvent | None)
clone(self) QgsTextAnnotation | None
Return type:

Optional[QgsTextAnnotation]

connectNotify(self, signal: QMetaMethod)
copyCommonProperties(self, target: QgsAnnotation | None)

Copies common annotation properties to the targe annotation. Can be used within QgsAnnotation.clone() implementations to assist with creating copies.

create() QgsTextAnnotation | None

Returns a new QgsTextAnnotation object.

Return type:

Optional[QgsTextAnnotation]

customEvent(self, a0: QEvent | None)
disconnectNotify(self, signal: QMetaMethod)
document(self) QTextDocument | None

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

See also

setDocument()

Return type:

Optional[QTextDocument]

isSignalConnected(self, signal: QMetaMethod) bool
minimumFrameSize(self) QSizeF

Returns the minimum frame size for the annotation. Subclasses should implement this if they cannot be resized smaller than a certain minimum size.

readXml(self, itemElem: QDomElement, context: QgsReadWriteContext)
Parameters:
receivers(self, signal: PYQT_SIGNAL) int
renderAnnotation(self, context: QgsRenderContext, size: QSizeF)
Parameters:
sender(self) QObject | None
senderSignalIndex(self) int
setDocument(self, doc: QTextDocument | None)

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

See also

document()

Parameters:

doc (Optional[QTextDocument])

timerEvent(self, a0: QTimerEvent | None)
writeXml(self, elem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext)
Parameters: