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.

© 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.