In questa pagina

ParallelAnimation QML Type

Consente l'esecuzione parallela delle animazioni. Altro...

Import Statement: import QtQuick
Inherits:

Animation

Descrizione dettagliata

I tipi SequentialAnimation e ParallelAnimation consentono di eseguire più animazioni contemporaneamente. Le animazioni definite in un'animazione sequenziale ( SequentialAnimation ) vengono eseguite una dopo l'altra, mentre quelle definite in un'animazione parallela (ParallelAnimation) vengono eseguite contemporaneamente.

L'animazione seguente esegue due animazioni numeriche in parallelo. L'Rectangle si sposta in (50,50) animando contemporaneamente le proprietà x e 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 }
    }
}

Come qualsiasi altro tipo di animazione, un ParallelAnimation può essere applicato in diversi modi, tra cui transizioni, comportamenti e fonti di valori delle proprietà. La documentazione "Animazione e transizioni in Qt Quick " illustra una varietà di metodi per la creazione di animazioni.

SequentialAnimation Nota: una volta che un’animazione è stata raggruppata in un’animazione sequenziale ( SequentialAnimation ) o parallela (ParallelAnimation), non può essere avviata o interrotta singolarmente; l’animazione sequenziale o parallela deve essere avviata e interrotta come gruppo.

Vedi anche SequentialAnimation, 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.