Class: QgsTextWidgetWrapper

Wraps a label widget to display text.

Added in version 3.30.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsTextWidgetWrapper

Base classes

QgsWidgetWrapper

Manages an editor widget.

QObject

class qgis.gui.QgsTextWidgetWrapper[source]

Bases: QgsWidgetWrapper

__init__(layer: QgsVectorLayer | None, editor: QWidget | None, parent: QWidget | None)

Create a text widget wrapper

Parameters:
  • layer (Optional[QgsVectorLayer]) – The layer on which the feature is

  • editor (Optional[QWidget]) – An editor widget. Can be None if one should be autogenerated.

  • parent (Optional[QWidget]) – A parent widget

needsGeometry(self) bool[source]

Returns true if the widget needs feature geometry

Return type:

bool

reinitWidget(self)[source]

Clears the content and makes new initialization

setText(self, text: str | None)[source]

Sets the text code to htmlCode

Parameters:

text (Optional[str])