Home · All Classes · All Functions · Overviews

QML Behavior Element Reference

The Behavior element allows you to specify a default animation for a property change. More...

Properties

Detailed Description

Behaviors provide one way to specify animations in QML.

In the example below, the rect will use a bounce easing curve over 200 millisecond for any changes to its y property:

 Rectangle {
     width: 20; height: 20
     color: "#00ff00"
     y: 200  //initial value
     y: Behavior {
         NumberAnimation {
             easing: "easeOutBounce(amplitude:100)"
             duration: 200
         }
     }
 }

Currently only a single Behavior may be specified for a property; this Behavior can be enabled and disabled via the enabled property.


Property Documentation

animation : Animation
default

The animation to use when the behavior is triggered.


enabled : bool

Whether the Behavior will be triggered when the property it is tracking changes.

By default a Behavior is enabled.



Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.7.0