ScaleAnimator QML Type

Le type ScaleAnimator anime le facteur d'échelle d'un élément. Plus d'informations...

Import Statement: import QtQuick
Inherits:

Animator

Description détaillée

Animator Les types Animator sont différents des types d'animation normaux. Lors de l'utilisation d'un Animator, l'animation peut être exécutée dans le fil de rendu et la valeur de la propriété sautera à la fin lorsque l'animation sera terminée.

La valeur de Item::scale est mise à jour une fois l'animation terminée.

L'extrait suivant montre comment utiliser un ScaleAnimator avec un élément Rectangle.

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

Il est également possible d'utiliser le mot-clé on pour lier le ScaleAnimator directement à une instance d'élément.

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

Voir également Item::transformOrigin et RotationAnimator.

© 2025 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 the GNU 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.