OpacityAnimator QML Type
OpacityAnimatorタイプは、Itemの不透明度をアニメーション化します。詳細...
| Import Statement: | import QtQuick |
| Inherits: |
詳しい説明
Animator タイプは通常の Animation タイプとは異なります。Animatorを使用する場合、アニメーションはレンダースレッドで実行することができ、アニメーションが完了するとプロパティ値は最後にジャンプします。
アニメーションが終了すると、Item::opacity の値が更新されます。
次のスニペットは、OpacityAnimator を Rectangle アイテムと一緒に使用する方法を示しています。
Rectangle { id: opacityBox width: 50 height: 50 color: "lightsteelblue" OpacityAnimator { target: opacityBox; from: 0; to: 1; duration: 1000 running: true } }
また、on キーワードを使用して、OpacityAnimator を Item インスタンスに直接結びつけることも可能です。
Rectangle { width: 50 height: 50 color: "lightsteelblue" OpacityAnimator on opacity{ from: 0; to: 1; duration: 1000 } }
注意: 非スレッドのレンダリングループを使用する場合、Animator タイプは何のメリットもありません。
注: アプリケーションでは、メイン(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.