IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

SequentialAnimation QML Type

Allows animations to be run sequentially.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

SequentialAnimation QML Type

  • Import Statement: import QtQuick

  • Inherits:: Animation

  • Group: SequentialAnimation is part of qtquick-transitions-animations

Detailed Description

The SequentialAnimation and ParallelAnimation types allow multiple animations to be run together. Animations defined in a SequentialAnimation are run one after the other, while animations defined in a ParallelAnimation are run at the same time.

The following example runs two number animations in a sequence. The Rectangle animates to a x position of 50, then to a y position of 50.

 
Sélectionnez
import QtQuick 2.0

Rectangle {
    id: rect
    width: 100; height: 100
    color: "red"

    SequentialAnimation {
        running: true
        NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
        NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
    }
}

Animations defined within a Transition are automatically run in parallel, so SequentialAnimation can be used to enclose the animations in a Transition if this is the preferred behavior.

Like any other animation type, a SequentialAnimation can be applied in a number of ways, including transitions, behaviors and property value sources. The Animation and Transitions in Qt Quick documentation shows a variety of methods for creating animations.

Once an animation has been grouped into a SequentialAnimation or ParallelAnimation, it cannot be individually started and stopped; the SequentialAnimation or ParallelAnimation must be started and stopped as a group.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+