Adding Connections

You can use the Connections view to:

  • Connect objects to signals.
  • Specify dynamic properties for objects.
  • Create bindings between the properties of two objects.

For examples of adding connections, see Creating Scalable Buttons and Borders.

Connecting Objects to Signals

To connect objects to signals in QML, create Connections objects.

To create the connections:

  1. Select the Connections tab.
  2. Select Target to add the object to connect to a signal.
  3. Select Signal Handler to select the signal that the connection will listen to from a list of all signals available for the object.
  4. Select Actions to specify the action to perform when the signal is emitted. You use JavaScript to specify the actions.

Specifying Dynamic Properties

You can bind Properties to dynamic expressions to define global properties for an object that can be read by other objects. For example, you can specify global properties for the root object that you can use in the child objects.

To specify dynamic properties for an object:

  1. Select the Properties tab.
  2. Select Item to select the object to specify the property for.
  3. Select Property to give a name to the property.
  4. Select Property Type to specify the type of the property.
  5. Select Property Value to specify the value of the property.

Adding Bindings Between Properties

To dynamically change the behavior of an object, you can create a Property Binding between the properties of two objects.

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

  1. Select the Bindings tab.
  2. Select Item to select the target object whose property you want to change dynamically.
  3. Select Property to select the property to bind to a source property.
  4. Select Source Item to select the object whose property you want to use to determine the behavior of the target object.
  5. Select Source Property to select the property to bind the target property to.

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