XAnimator QML Type

Le type XAnimator anime la position x d'un élément. Plus d'informations...

Import Statement: import QtQuick
Inherits:

Animator

Description détaillée

Animator Les types XAnimator 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::x est mise à jour une fois l'animation terminée.

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

Rectangle {
    id: xmovingBox
    width: 50
    height: 50
    color: "lightsteelblue"
    XAnimator {
        target: xmovingBox;
        from: 10;
        to: 0;
        duration: 1000
        running: true
    }
}

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

Rectangle {
    width: 50
    height: 50
    color: "lightsteelblue"
    XAnimator on x {
        from: 10;
        to: 0;
        duration: 1000
    }
}

© 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.