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>
This commit is contained in:
parent
a1ca0c99de
commit
57b4e30ff8
@ -1175,6 +1175,17 @@ QString QPropertyBindingError::description() const
|
|||||||
dynamically, the binding expression. It is represented as a C++ lambda and
|
dynamically, the binding expression. It is represented as a C++ lambda and
|
||||||
can be used to express relationships between different properties in your
|
can be used to express relationships between different properties in your
|
||||||
application.
|
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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user