Sur cette page

ParallelAnimation QML Type

Permet d'exécuter des animations en parallèle. En savoir plus...

Import Statement: import QtQuick
Inherits:

Animation

Description détaillée

Les types « SequentialAnimation » et « ParallelAnimation » permettent d’exécuter plusieurs animations simultanément. Les animations définies dans une « SequentialAnimation » s’exécutent les unes après les autres, tandis que celles définies dans une « ParallelAnimation » s’exécutent en même temps.

L'animation suivante exécute deux animations numériques en parallèle. L'Rectangle se déplace vers (50,50) en animant simultanément ses propriétés « x » et « y ».

import QtQuick

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

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

Comme tout autre type d’animation, une ParallelAnimation peut être appliquée de différentes manières, notamment via des transitions, des comportements et des sources de valeurs de propriété. La documentation « Animation et transitions dans les Qt Quick s » présente diverses méthodes pour créer des animations.

Remarque : une fois qu’ une animation a été regroupée au sein d’une SequentialAnimation ou d’une ParallelAnimation, elle ne peut plus être lancée ou arrêtée individuellement ; la SequentialAnimation ou la ParallelAnimation doit être lancée et arrêtée en tant que groupe.

Voir également « SequentialAnimation» , «Animations et transitions dans Qt Quick » et «Exemples d'Qt Quick - Animation».

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