YAnimator QML Type
YAnimatorタイプは、Itemのy位置をアニメートする。詳細...
| Import Statement: | import QtQuick |
| Inherits: |
詳細説明
Animator YAnimatorタイプは通常のAnimationタイプとは異なります。Animatorを使用する場合、アニメーションはレンダースレッドで実行することができ、アニメーションが完了するとプロパティ値は最後にジャンプします。
アニメーションが終了すると、Item::y の値が更新されます。
次のスニペットは、YAnimator を Rectangle アイテムと一緒に使用する方法を示しています。
Rectangle { id: ymovingBox width: 50 height: 50 color: "lightsteelblue" YAnimator { target: ymovingBox; from: 10; to: 0; duration: 1000 running: true } }
また、on キーワードを使用して、YAnimator を Item インスタンスに直接結びつけることも可能です。
Rectangle { width: 50 height: 50 color: "lightsteelblue" YAnimator on y { from: 10; to: 0; duration: 1000 } }
注意 : アニメータータイプは、スレッド化されていないレンダリングループを使用する場合、何のメリットもありません。
注意 : アプリケーションでは、メイン(GUI)スレッドで高価なブロッキング処理を行いながらアニメーション・コンテンツを表示するアニメーターに依存するのではなく、マルチスレッド、非同期の原則に基づいた設計を検討することをお勧めします。QMLではWorkerScript 、asynchronous image loading 、C++ではワーカースレッド、並列アルゴリズムなどを使用します、 Qt ConcurrentC++では、ワーカースレッド、並列アルゴリズム、コルーチンを使用することで、アプリケーション全体とUIを常に反応する状態に保つことができます。
© 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.