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
- rtype:
Optional[QgsTextAnnotation]
Copies common annotation properties to the
targe
annotation.Returns a new
QgsTextAnnotation
object.Returns the text document which will be rendered within the annotation.
Returns the minimum frame size for the annotation.
- param itemElem:
- param context:
Sets the text document which will be rendered within the annotation.
- 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 withinQgsAnnotation.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
- 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:
itemElem (QDomElement)
context (QgsReadWriteContext)
- receivers(self, signal: PYQT_SIGNAL) int ¶
- renderAnnotation(self, context: QgsRenderContext, size: QSizeF)¶
- Parameters:
context (QgsRenderContext)
size (QSizeF)
- 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
- Parameters:
doc (Optional[QTextDocument])
- timerEvent(self, a0: QTimerEvent | None)¶
- writeXml(self, elem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext)¶
- Parameters:
elem (QDomElement)
doc (QDomDocument)
context (QgsReadWriteContext)