Class: QgsQmlWidgetWrapper

Wraps a QQuickWidget to display QML code

Added in version 3.4.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsQmlWidgetWrapper

Base classes

QgsWidgetWrapper

Manages an editor widget Widget and wrapper share the same parent

QObject

Methods

reinitWidget

Clears the content and makes new initialization

setQmlCode

writes the qmlCode into a temporary file

class qgis.gui.QgsQmlWidgetWrapper[source]

Bases: QgsWidgetWrapper

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

Create a qml 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

reinitWidget(self)[source]

Clears the content and makes new initialization

setQmlCode(self, qmlCode: str | None)[source]

writes the qmlCode into a temporary file

Parameters:

qmlCode (Optional[str])