Home · All Classes · All Functions · Overviews

QML SpringFollow Element Reference

The SpringFollow element allows a property to track a value. More...

Properties

Detailed Description

In example below, rect2 will follow rect1 moving with a velocity of up to 200:

 Rectangle {
     id: rect1
     width: 20; height: 20
     color: "#00ff00"
     y: 200  //initial value
     y: SequentialAnimation {
         running: true
         repeat: true
         NumberAnimation {
             to: 200
             easing: "easeOutBounce(amplitude:100)"
             duration: 2000
         }
         PauseAnimation { duration: 1000 }
     }
 }
 Rectangle {
     id: rect2
     x: rect1.width
     width: 20; height: 20
     color: "#ff0000"
     y: SpringFollow { source: rect1.y; velocity: 200 }
 }

See also EaseFollow.


Property Documentation

damping : qreal

This property holds the spring damping constant

The damping constant describes how quickly a sprung follower comes to rest. Useful range is 0 - 1.0


enabled : bool

This property holds whether the target will track the source.


epsilon : qreal

This property holds the spring epsilon

The epsilon is the rate and amount of change in the value which is close enough to 0 to be considered equal to zero. This will depend on the usage of the value. For pixel positions, 0.25 would suffice. For scale, 0.005 will suffice.

The default is 0.01. Tuning this value can provide small performance improvements.


read-onlyinSync : bool

This property is true when target is equal to the source; otherwise false. If inSync is true the target is not being animated.

If enabled is false then inSync will also be false.


mass : qreal

This property holds the "mass" of the property being moved.

mass is 1.0 by default. Setting a different mass changes the dynamics of a spring follow.


modulus : qreal

This property holds the modulus value.

Setting a modulus forces the target value to "wrap around" at the modulus. For example, setting the modulus to 360 will cause a value of 370 to wrap around to 10.


source : qreal

This property holds the source value which will be tracked.

Bind to a property in order to track its changes.


spring : qreal

This property holds the spring constant

The spring constant describes how strongly the target is pulled towards the source. Setting spring to 0 turns off spring tracking. Useful values 0 - 5.0

When a spring constant is set and the velocity property is greater than 0, velocity limits the maximum speed.


read-onlyvalue : qreal

The current value.


velocity : qreal

This property holds the maximum velocity allowed when tracking the source.



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