16#ifndef QGSQMLWIDGETWRAPPER_H
17#define QGSQMLWIDGETWRAPPER_H
24#include <QQuickWidget>
26class QgsQmlAttributeFormBridge;
47 bool valid()
const override;
67 QTemporaryFile mQmlFile;
69 QQuickWidget *mWidget =
nullptr;
70 QgsQmlAttributeFormBridge *mWidgetBridge =
nullptr;
73 bool mRequiresFormScope =
false;
85class QgsQmlExpression :
public QObject
94 Q_INVOKABLE QVariant evaluate(
const QString &expression )
const;
106class QgsQmlAttributeFormBridge :
public QObject
111 Q_PROPERTY( QgsVectorLayer *layer READ layer )
114 Q_PROPERTY(
bool editable READ editable NOTIFY editableChanged )
117 Q_PROPERTY( QgsAttributeEditorContext context READ context NOTIFY contextChanged )
123 Q_PROPERTY( QgsFeature currentFormFeature READ currentFormFeature NOTIFY currentFormFeatureChanged )
131 QgsQmlAttributeFormBridge( QgsAttributeForm *form, QObject *parent =
nullptr );
132 ~QgsQmlAttributeFormBridge()
override =
default;
135 bool editable()
const;
138 QgsVectorLayer *layer()
const;
141 QgsAttributeEditorContext context()
const;
144 void setContext(
const QgsAttributeEditorContext &context );
150 QgsFeature currentFormFeature()
const;
155 Q_INVOKABLE
void changeGeometry(
const QgsGeometry &geometry );
164 Q_INVOKABLE
void changeAttribute(
const QString &field,
const QVariant &value );
171 Q_INVOKABLE QVariant attribute(
const QString &field );
175 void editableChanged();
178 void contextChanged();
181 void currentFormFeatureChanged();
184 QgsAttributeForm *mForm =
nullptr;
185 QgsAttributeEditorContext mContext;
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Represents a vector layer which manages a vector based dataset.