Qt 4.8
|
The SpringAnimation element allows a property to track a value in a spring-like motion. More...
The SpringAnimation element allows a property to track a value in a spring-like motion.
SpringAnimation mimics the oscillatory behavior of a spring, with the appropriate spring constant to control the acceleration and the damping to control how quickly the effect dies away.
You can also limit the maximum velocity of the animation.
The following Rectangle moves to the position of the mouse using a SpringAnimation when the mouse is clicked. The use of the Behavior on the x
and y
values indicates that whenever these values are changed, a SpringAnimation should be applied.
Like any other animation element, a SpringAnimation can be applied in a number of ways, including transitions, behaviors and property value sources. The QML Animation and Transitions documentation shows a variety of methods for creating animations.