diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2014-05-14 22:33:34 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-16 03:45:07 +0200 |
commit | ea401b8ebff8ee58f6db7b1c623883a72365a2b8 (patch) | |
tree | 9156aee24509c117d111ba41c6fa66067ab5ea33 /src/qml/doc/src/cppintegration | |
parent | d3064953f12d780e06578d97990533c93b3c2781 (diff) |
Doc: Describe property bindings in terms of relationships
- This patch aims to help readers think about bindings more
"declaratively" by introducing a new (albeit very leaky) level of
abstraction: Treat bindings as finitary relations, rather than mere
JavaScript expressions.
- In essence, property bindings are for describing relationships between
properties. The fact that the QML engine reactively updates a
property's value when its dependencies change, and the fact that
arbitrarily complex expressions are valid bindings, are simply
implementation details.
- Discourage the use of side effects in property bindings. They are not
essential for the main purpose of property bindings, they break the
finitary relation model, and their use can reduce code
readability/maintainability/toolability.
- Discourage complex property bindings for similar reasons.
Change-Id: I5a0a03bd02768d4c504797a0f86569f3ac066e96
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/qml/doc/src/cppintegration')
-rw-r--r-- | src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index 86715e93f1..f02c3da6af 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -148,8 +148,9 @@ Text { For maximum interoperability with QML, \b {any property that is writable should have an associated NOTIFY signal} that is emitted whenever the property value has changed. This allows the property to be used with \l{Property -Binding}{property binding}, which is an essential feature of QML that enables -specific values to be updated whenever an associated property changes. +Binding}{property binding}, which is an essential feature of QML that enforces +relationships between properties by automatically updating a property whenever +any of its dependencies change in value. In the above example, the associated NOTIFY signal for the \c author property is \c authorChanged, as specified in the Q_PROPERTY() macro call. This means that |