Adding Bindings Between Properties | Qt Creator Manual

Qt Creator Manual | Adding Bindings Between Properties

Qt Creator Manual 4.7.1

Specifying Dynamic Properties ◦ Managing C++ Backend Objects

# Adding Bindings Between Properties

To dynamically change the behavior of an object, you can create a binding between the properties of two objects. To create a property binding, a property is assigned a JavaScript expression that evaluates to the desired value. At its simplest, a binding may be a reference to another property. For example, the height of an object can be bound to the height of its parent, so that when the parent height changes, the object height is adjusted automatically.

For more information about the use of property bindings, see Property Binding.

You can create bindings between objects in the Connections view.

To bind a property of an object to the property of another object:

1. In the Connections view, select the Bindings tab.
2. Select the (Add) button to add a binding.
3. Select Item to select the target object whose property you want to change dynamically.
4. Select Property to select the property to bind to a source property.
5. Select Source Item to select the object whose property you want to use to determine the behavior of the target object.
6. Select Source Property to select the property to bind the target property to.

Specifying Dynamic Properties ◦ Managing C++ Backend Objects