ScaleAnimator QML Type
ScaleAnimator 型は、アイテムのスケール係数をアニメーション化します。詳細...
| Import Statement: | import QtQuick |
| Inherits: |
詳細な説明
Animator この型は、通常の Animation 型とは異なります。Animator を使用する場合、アニメーションはレンダリングスレッドで実行され、アニメーションが完了するとプロパティの値は最終値にジャンプします。
Item::scale の値は、アニメーションが終了した後に更新されます。
以下のスニペットは、ScaleAnimator を Rectangle アイテムと組み合わせて使用方法を示しています。
Rectangle {
id: scalingBox
width: 50
height: 50
color: "lightsteelblue"
ScaleAnimator {
target: scalingBox;
from: 0.5;
to: 1;
duration: 1000
running: true
}
}また、on キーワードを使用して、ScaleAnimator を Item インスタンスに直接紐付けることも可能です。
Rectangle {
width: 50
height: 50
color: "lightsteelblue"
ScaleAnimator on scale {
from: 0.5;
to: 1;
duration: 1000
}
}注: スレッド化されていないレンダリングループを使用する場合、Animator タイプにはメリットがありません。
注: アプリケーションでは、メイン(GUI)スレッドで負荷が高く、ブロックする処理を実行しながら、アニメーターに依存してアニメーションコンテンツを表示するのではなく、マルチスレッドおよび非同期の原則に基づいた設計を検討することをお勧めします 。長時間のブロック操作の代わりに、QML では `WorkerScript ` や `asynchronous image loading ` を、C++ ではワーカースレッド、並列アルゴリズム、 Qt Concurrent、およびC++のコルーチンなどを優先的に使用し、アプリケーション全体とUIの応答性を常に維持するようにしてください。
Item::transformOrigin およびRotationAnimatorも参照してください 。
© 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.