QgsAttributeEditorQmlElement class

An attribute editor widget that will represent arbitrary QML code.

Base classes

class QgsAttributeEditorElement
This is an abstract base class for any elements of a drag and drop form.

Constructors, destructors, conversion operators

QgsAttributeEditorQmlElement(const QString& name, QgsAttributeEditorElement* parent)
Creates a new element which can display QML.

Public functions

auto clone(QgsAttributeEditorElement* parent) const -> QgsAttributeEditorElement* override
Returns a clone of this element.
auto qmlCode() const -> QString
The QML code that will be represented within this widget.
void setQmlCode(const QString& qmlCode)
The QML code that will be represented within this widget.

Private functions

void saveConfiguration(QDomElement& elem) const override
Should be implemented by subclasses to save type specific configuration.
auto typeIdentifier() const -> QString override
All subclasses need to overwrite this method and return a type specific identifier.

Function documentation

QgsAttributeEditorQmlElement::QgsAttributeEditorQmlElement(const QString& name, QgsAttributeEditorElement* parent)

Creates a new element which can display QML.

Parameters
name The name of the widget
parent The parent (used as container)

QgsAttributeEditorElement* QgsAttributeEditorQmlElement::clone(QgsAttributeEditorElement* parent) const override

Returns a clone of this element.

To be implemented by subclasses.

QString QgsAttributeEditorQmlElement::qmlCode() const

The QML code that will be represented within this widget.

void QgsAttributeEditorQmlElement::setQmlCode(const QString& qmlCode)

The QML code that will be represented within this widget.

Parameters
qmlCode

void QgsAttributeEditorQmlElement::saveConfiguration(QDomElement& elem) const override private

Should be implemented by subclasses to save type specific configuration.

QString QgsAttributeEditorQmlElement::typeIdentifier() const override private

All subclasses need to overwrite this method and return a type specific identifier.

Needs to be XML key compatible.