Qt 4.8
NumberAnimation Class Reference

The NumberAnimation element animates changes in qreal-type values. More...

Inheritance diagram for NumberAnimation:
PropertyAnimation Animation SmoothedAnimation SpringAnimation

Detailed Description

The NumberAnimation element animates changes in qreal-type values.

Since
4.7

NumberAnimation is a specialized PropertyAnimation that defines an animation to be applied when a numerical value changes.

Here is a NumberAnimation applied to the x property of a Rectangle as a property value source. It animates the x value from its current value to a value of 50, over 1000 milliseconds:

import QtQuick 1.0
Rectangle {
width: 100; height: 100
color: "red"
NumberAnimation on x { to: 50; duration: 1000 }
}

Like any other animation element, a NumberAnimation 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.

Note that NumberAnimation may not animate smoothly if there are irregular changes in the number value that it is tracking. If this is the case, use SmoothedAnimation instead.

See also
{QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}

The documentation for this class was generated from the following file: