
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheColorAnimation element animates changes in color values.More...
| Since: | Qt 4.7 |
| Inherits: |
ColorAnimation is a specializedPropertyAnimation that defines an animation to be applied when a color value changes.
Here is aColorAnimation applied to thecolor property of aRectangle as a property value source. It animates thecolor property's value from its current value to a value of "red", over 1000 milliseconds:
import QtQuick 1.0Rectangle {width:100;height:100color:"red" ColorAnimation oncolor {to:"yellow";duration:1000 }}
Like any other animation element, aColorAnimation can be applied in a number of ways, including transitions, behaviors and property value sources. TheQML Animation and Transitions documentation shows a variety of methods for creating animations.
For convenience, when aColorAnimation is used in aTransition, it will animate anycolor properties that have been modified during the state change. If aproperty orproperties are explicitly set for the animation, then those are used instead.
See alsoQML Animation and Transitions and Animation basics example.
This property holds the color value at which the animation should begin.
For example, the following animation is not applied until a color value has reached "#c0c0c0":
Item {states: [// States are defined here... ]transition:Transition {NumberAnimation {from:"#c0c0c0";duration:2000 } }}
If theColorAnimation is defined within aTransition orBehavior, this value defaults to the value defined in the starting state of theTransition, or the current value of the property at the moment theBehavior is triggered.
See alsoQML Animation and Transitions.
This property holds the color value at which the animation should end.
If theColorAnimation is defined within aTransition orBehavior, this value defaults to the value defined in the end state of theTransition, or the value of the property change that triggered theBehavior.
See alsoQML Animation and Transitions.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.