Qt 4.8
|
The Binding element allows arbitrary property bindings to be created. More...
The Binding element allows arbitrary property bindings to be created.
Sometimes it is necessary to bind to a property of an object that wasn't directly instantiated by QML - generally a property of a class exported to QML by C++. In these cases, regular property binding doesn't work. Binding allows you to bind any value to any property.
For example, imagine a C++ application that maps an "app.enteredText" property into QML. You could use Binding to update the enteredText property like this.
Whenever the text in the TextEdit is updated, the C++ property will be updated also.
If the binding target or binding property is changed, the bound value is immediately pushed onto the new target.