Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

ColorAnimation

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

Inherits PropertyAnimation

Properties

Detailed Description

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 2.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 property or properties are explicitly set for the animation, then those are used instead.

See also QML Animation and Transitions and Animation basics example.

Property Documentation

from : color

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 {
         ColorAnimation { from: "#c0c0c0"; duration: 2000 }
     }
 }

If the ColorAnimation is defined within a Transition or Behavior, this value defaults to the value defined in the starting state of the Transition, or the current value of the property at the moment the Behavior is triggered.

See also QML Animation and Transitions.


to : color

This property holds the color value at which the animation should end.

If the ColorAnimation is defined within a Transition or Behavior, this value defaults to the value defined in the end state of the Transition, or the value of the property change that triggered the Behavior.

See also QML Animation and Transitions.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web