QML NumberAnimation ElementThe NumberAnimation element animates changes in qreal-type values. More... Inherits PropertyAnimation Inherited by SmoothedAnimation and SpringAnimation. This element was introduced in Qt 4.7. PropertiesDetailed DescriptionNumberAnimation 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 and Animation basics example. Property DocumentationThis property holds the starting value for the animation. For example, the following animation is not applied until the x value has reached 100: Item { states: [ // ... ] transition: Transition { NumberAnimation { properties: "x"; from: 100; duration: 200 } } } If the NumberAnimation 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. This property holds the end value for the animation. If the NumberAnimation 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 4.8 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com