SequentialAnimation QML Type
Consente l'esecuzione sequenziale delle animazioni. Altro...
| Import Statement: | import QtQuick |
| Inherits: |
Descrizione dettagliata
I tipi SequentialAnimation e ParallelAnimation consentono di eseguire più animazioni contemporaneamente. Le animazioni definite in un SequentialAnimation vengono eseguite una dopo l'altra, mentre quelle definite in un ParallelAnimation vengono eseguite contemporaneamente.
L’esempio seguente esegue due animazioni numeriche in sequenza. L’ Rectangle si anima fino a una posizione di x pari a 50, quindi fino a una posizione di y pari a 50.
import QtQuick
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 }
}
}Le animazioni definite all'interno di un'Transition vengono eseguite automaticamente in parallelo, pertanto è possibile utilizzare SequentialAnimation per racchiudere le animazioni in un'Transition, qualora si preferisca tale comportamento.
Come qualsiasi altro tipo di animazione, una SequentialAnimation può essere applicata in diversi modi, tra cui transizioni, comportamenti e fonti di valori delle proprietà. La documentazione "Animazioni e transizioni in Qt Quick " illustra una varietà di metodi per la creazione di animazioni.
Nota: una volta che un’animazione è stata raggruppata in una SequentialAnimation o in un’ ParallelAnimation, non può essere avviata o interrotta singolarmente; la SequentialAnimation o l’ ParallelAnimation devono essere avviate e interrotte come gruppo.
Vedi anche ParallelAnimation, Animazioni e transizioni in Qt Quick e Esempi diQt Quick: Animazione.
© 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.