Qt 4.8
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ColorAnimation Class Reference

The ColorAnimation element animates changes in color values. More...

Inheritance diagram for ColorAnimation:
PropertyAnimation Animation

Detailed Description

The ColorAnimation element animates changes in color values.

Since
4.7

ColorAnimation is a specialized PropertyAnimation that defines an animation to be applied when a color value changes.

Here is a ColorAnimation applied to the color property of a Rectangle as a property value source. It animates the color property's value from its current value to a value of "red", over 1000 milliseconds:

import QtQuick 1.0
Rectangle {
width: 100; height: 100
color: "red"
ColorAnimation on color { to: "yellow"; duration: 1000 }
}

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

For convenience, when a ColorAnimation is used in a Transition , it will animate any color properties that have been modified during the state change. If a PropertyAnimation::property or PropertyAnimation::properties are explicitly set for the animation, then those are used instead.

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

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