summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJaishree Vyas <Jaishree.Vyas@qt.io>2022-06-28 14:01:05 +0200
committerJaishree Vyas <Jaishree.Vyas@qt.io>2022-07-25 09:46:42 +0200
commit57b4e30ff8841da682cc5e27c2b4abf571838e32 (patch)
tree797f8966089c1d6e80d16cab841ae366a50e39c8 /src
parenta1ca0c99deef5fcacb05d004ce69025886a220a4 (diff)
Write QProperty use in QML
Details: Added a note on how QProperty works in QML using BINDABLE keyword Task-number: QTBUG-89166 Change-Id: Ib48dd26b0724f906efa65d14fbb75a8b97255b05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qproperty.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp
index 482ed3bf35..a635cb8afc 100644
--- a/src/corelib/kernel/qproperty.cpp
+++ b/src/corelib/kernel/qproperty.cpp
@@ -1175,6 +1175,17 @@ QString QPropertyBindingError::description() const
dynamically, the binding expression. It is represented as a C++ lambda and
can be used to express relationships between different properties in your
application.
+
+ \note In the case of QML it is important that \l QProperty needs to be exposed
+ in \l Q_PROPERTY with the BINDABLE keyword. As a result the QML engine, uses it
+ as the bindable interface to set up the property binding. In turn, the binding
+ can be then interacted with C++ via the normal API like:
+
+ QProperty<T>::onValueChanged, QProperty::takeBinding and QBindable::hasBinding
+
+ If the property is BINDABLE, then the engine will use the change-tracking
+ inherent to the C++ property system for getting notified about changes; and
+ won't rely on signals being emitted.
*/
/*!