Class: QgsTextAnnotation

class qgis.core.QgsTextAnnotation

Bases: QgsAnnotation

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

New in version 3.0.

QgsTextAnnotation(parent: QObject = None) Constructor for QgsTextAnnotation.

Methods

childEvent

clone

rtype

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, QChildEvent)
clone(self) QgsTextAnnotation
Return type

QgsTextAnnotation

connectNotify(self, QMetaMethod)
copyCommonProperties(self, target: QgsAnnotation)

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

create() QgsTextAnnotation

Returns a new QgsTextAnnotation object.

Return type

QgsTextAnnotation

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
document(self) QTextDocument

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

See also

setDocument()

Return type

QTextDocument

isSignalConnected(self, 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, PYQT_SIGNAL) int
renderAnnotation(self, context: QgsRenderContext, size: QSizeF)
Parameters
sender(self) QObject
senderSignalIndex(self) int
setDocument(self, doc: QTextDocument)

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

See also

document()

Parameters

doc (QTextDocument) –

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