このページでは

ParallelAnimation QML Type

アニメーションを並行して実行できるようにします。詳細...

Import Statement: import QtQuick
Inherits:

Animation

詳細な説明

SequentialAnimation およびParallelAnimation型を使用すると、複数のアニメーションを同時に実行できます。SequentialAnimation で定義されたアニメーションは順番に実行されますが、ParallelAnimationで定義されたアニメーションは同時に実行されます。

次のアニメーションでは、2つの数値アニメーションを並列で実行しています。Rectangle は、x プロパティとy プロパティを同時にアニメーション化することで、(50,50)の位置まで移動します。

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 }
    }
}

他のアニメーションタイプと同様に、ParallelAnimationは、トランジション、ビヘイビア、プロパティ値ソースなど、さまざまな方法で適用できます。「 Qt Quick のアニメーションとトランジション」のドキュメントでは、アニメーションを作成するためのさまざまな方法が紹介されています。

注: アニメーションがSequentialAnimation または ParallelAnimation にグループ化されると 、個別に開始・停止することはできません。SequentialAnimation または ParallelAnimation は、グループとしてまとめて開始・停止する必要があります。

「 SequentialAnimation」 、「Qt Quick 」の「アニメーションとトランジション」、および「Qt Quick の例 - アニメーション」も参照してください 。

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