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

ScaleAnimator QML Type

The ScaleAnimator type animates the scale factor of an Item.

This type was introduced in Qt 5.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ScaleAnimator QML Type

  • Import Statement: import QtQuick

  • Since:: Qt 5.2

  • Inherits:: Animator

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

Detailed Description

Animator types are different from normal Animation types. When using an Animator, the animation can be run in the render thread and the property value will jump to the end when the animation is complete.

The value of Item::scale is updated after the animation has finished.

The following snippet shows how to use a ScaleAnimator together with a Rectangle item.

 
Sélectionnez
Rectangle {
    id: scalingBox
    width: 50
    height: 50
    color: "lightsteelblue"
    ScaleAnimator {
        target: scalingBox;
        from: 0.5;
        to: 1;
        duration: 1000
        running: true
    }
}

It is also possible to use the on keyword to tie the ScaleAnimator directly to an Item instance.

 
Sélectionnez
Rectangle {
    width: 50
    height: 50
    color: "lightsteelblue"
    ScaleAnimator on scale {
        from: 0.5;
        to: 1;
        duration: 1000
    }
}

See Also

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