Skip to content

Commit

Permalink
Write QProperty use in QML
Browse files Browse the repository at this point in the history
Details: Added a note on how QProperty works in QML using BINDABLE keyword

Task-number: QTBUG-89166
Change-Id: Ib48dd26b0724f906efa65d14fbb75a8b97255b05
Reviewed-by: Fabian Kosmale <[email protected]>
  • Loading branch information
jaishree04 committed Jul 25, 2022
1 parent a1ca0c9 commit 57b4e30
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/corelib/kernel/qproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/*!
Expand Down

0 comments on commit 57b4e30

Please sign in to comment.