15\li \l {ParallelAnimation} - Runs animations in parallel
16\li \l {Behavior} - Specifies a default animation for property changes
17\li \l {PropertyAction} - Sets immediate property changes during animation
18\li \l {PauseAnimation} - Introduces a pause in an animation
19\li \l {SmoothedAnimation} - Allows a property to smoothly track a value
20\li \l {SpringAnimation} - Allows a property to track a value in a spring-like motion
21\li \l {ScriptAction} - Runs scripts during an animation
22\endlist
23
24Types that animate properties based on data types
25\annotatedlist qtquick-animation-properties
26
27Animations are created by applying animation types to property
28values. Animation types will interpolate property values to create smooth
29transitions. As well, state transitions may assign animations to state changes.
30
31To create an animation, use an appropriate animation type for the type of
32the property that is to be animated, and apply the animation depending on the
33type of behavior that is required.
34
35\sa {Qt Quick Examples - Animation}
36
37\section1 Triggering Animations
38
39There are several ways of setting animation to an object.
40
41\section2 Direct Property Animation
42
43Animations are created by applying animation objects to property values to
44gradually change the properties over time. These \e {property animations} apply
45smooth movements by interpolating values between property value changes. Property
46animations provide timing controls and allows different interpolations through
47\l{qml-easing-animation}{easing curves}.
48
49\snippet qml/animation.qml property animation
50
51Specialized property animation types
52have more efficient implementations than the \l{PropertyAnimation} type. They
53are for setting animations to different QML types such as \c int, \c color, and
54rotations. Similarly, the \l{ParentAnimation} can animate parent changes.
55
56See the \l {qml-controlling-animations}{Controlling Animations} section for more
57information about the different animation properties.
58
59
60\section2 Using Predefined Targets and Properties
61
62In the previous example, the PropertyAnimation and NumberAnimation objects needed
63to specify particular \l {PropertyAnimation::}{target} and \l {PropertyAnimation::}{properties}
64values to specify the objects and properties that should be animated. This can be
65avoided by using the \e {<Animation> on <Property>} syntax, which specifies the
66animation is to be applied as a \e {property value source}.
67
68Below are two PropertyAnimation objects that are specified using this syntax:
69
70\qml
71import QtQuick 2.0
72
73Rectangle {
74 id: rect
75 width: 100; height: 100
76 color: "red"
77
78 PropertyAnimation on x { to: 100 }
79 PropertyAnimation on y { to: 100 }
80}
81\endqml
82
83The animation starts as soon as the rectangle is loaded, and will automatically be
84applied to its \c x and \c y values. Since the \e {<Animation> on <Property>}
85syntax has been used, it is not necessary to set the
86\l {PropertyAnimation::}{target} value of the PropertyAnimation objects to
87\c rect, and neither is it necessary to set the \l {PropertyAnimation::}{property}
88values to \c x and \c y.
89
90This can also be used by \l{Playing Animations in Parallel or in Sequence}
91{grouped animations} to ensure that all animations within a group are applied to
92the same property. For example, the previous example could instead use
93SequentialAnimation to animate the rectangle's \c color first to yellow, then
94to blue:
95
96\qml
97import QtQuick 2.0
98
99Rectangle {
100 width: 100; height: 100
101 color: "red"
102
103 SequentialAnimation on color {
104 ColorAnimation { to: "yellow"; duration: 1000 }
105 ColorAnimation { to: "blue"; duration: 1000 }
106 }
107}
108\endqml
109
110Since the SequentialAnimation object has been specified on the \c color property
111using the \e {<Animation> on <Property>} syntax, its child ColorAnimation objects
112are also automatically applied to this property and do not need to specify
113\l {PropertyAnimation::}{target} or \l {PropertyAnimation::}{property} animation
114values.
115
116
117\target qml-transition-animations
118\section2 Transitions During State Changes
119
120\l{State}{Qt Quick States} are property configurations where a property may have different values to reflect different states. State changes introduce
121abrupt property changes; animations smooth transitions to produce visually
122appealing state changes.
123
124The \l [QML] {Transition} type can contain animation types to interpolate
125property changes caused by state changes. To assign the transition to an object,
126bind it to the \c transitions property.
127
128A button might have two states, the \c pressed state when the user clicks on the
129button and a \c released state when the user releases the button. We can assign
130different property configurations for each state. A transition would animate the
131change from the \c pressed state to the \c released state. Likewise, there would
132be an animation during the change from the \c released state to the \c pressed