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/qproperty.cpp | |
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/qproperty.cpp')
-rw-r--r-- | src/corelib/kernel/qproperty.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index 75110fa031..ba91db3b5d 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -611,6 +611,19 @@ QPropertyBindingSourceLocation QPropertyBindingError::location() const */ /*! + \fn template <typename T> QPropertyBinding<T> bool QProperty<T>::setBinding(const QUntypedPropertyBinding &newBinding) + \overload + + Associates the value of this property with the provided \a newBinding + expression. The first time the property value is read, the binding is evaluated. + Whenever a dependency of the binding changes, the binding will be re-evaluated + the next time the value of this property is read. + + Returns true if the type of this property is the same as the type the binding + function returns; false otherwise. +*/ + +/*! \fn template <typename T> QPropertyBinding<T> QProperty<T>::binding() const Returns the binding expression that is associated with this property. A |