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 for the currently selected item. The ID is displayed in the Item column.
  3. Double-click the value in the Property column to select the property to bind to a source property.
  4. Double-click the value in the Source Item column to select the object whose property you want to use to determine the behavior of the target object.
  5. Double-click the value in the Source Property column to select the property to bind the target property to.

Right-click a binding and select Open Binding Editor in the context menu to specify the binding as a JavaScript expression in Binding Editor. For more information, see Setting Bindings.

"Binding Editor"

© 2020 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.