diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-03 10:15:18 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-19 13:08:56 +0100 |
commit | 1fcce5105388b41c24c60324f678afb2d05e687f (patch) | |
tree | 3364991ecdf96c8200dd1f5703d43e1ba322909d /src/corelib/kernel/qpropertybinding_p.h | |
parent | 3c2aa878dceae77144e548eb839c7c76893874eb (diff) |
Enable generic property bindings to QProperty<T>
A generic binding allows implementing the binding function in a way that
enables the QML engine to run binding scripts and convert the V4::Value
into a QVariant and then assign the value to the property with the help
of QMetaType::construct.
Change-Id: Id4807be92eee7e3501908e6c5e4c861cfcb7772a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qpropertybinding_p.h')
-rw-r--r-- | src/corelib/kernel/qpropertybinding_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/kernel/qpropertybinding_p.h b/src/corelib/kernel/qpropertybinding_p.h index 12913b3088..92638c92cc 100644 --- a/src/corelib/kernel/qpropertybinding_p.h +++ b/src/corelib/kernel/qpropertybinding_p.h @@ -74,13 +74,16 @@ struct QPropertyBindingPrivate : public QSharedData QPropertyBindingSourceLocation location; QPropertyBindingError error; + QMetaType metaType; + bool dirty = false; bool updating = false; - QPropertyBindingPrivate(QUntypedPropertyBinding::BindingEvaluationFunction evaluationFunction, + QPropertyBindingPrivate(const QMetaType &metaType, QUntypedPropertyBinding::BindingEvaluationFunction evaluationFunction, const QPropertyBindingSourceLocation &location) : evaluationFunction(std::move(evaluationFunction)) , location(location) + , metaType(metaType) {} virtual ~QPropertyBindingPrivate(); |