easingCurve QML Value Type
緩和曲線を表す値。詳細...
| Since: | Qt 6.11 |
詳細説明
easingCurve 型は、easing curve を定義する属性を持つ値です:
enumeration typereal amplitudereal overshootreal periodlist<real> bezierCurve
この型は、FrameAnimation でカスタム・アニメーションを行う場合や、指定した曲線に沿って値をイージングする必要がある場合に便利です。
easingCurve 値を作成するには、QtQml (またはQtQuick )を名前空間にインポートします:
import QtQml as QtQml
次に、new でそのインスタンスを作成します:
readonly property easingCurve easingCurve: Easing.InQuart
次の例は、Easing のドキュメントで説明されているものと似ています:
Rectangle { id: rect width: 100 height: 100 anchors.centerIn: parent color: "red" opacity: 0 } FrameAnimation { id: frameAnimation running: true property real elapsed // In seconds. readonly property real duration: 2 // Two seconds. readonly property easingCurve easingCurve: Easing.InQuart onTriggered: { elapsed += frameTime // Loop once we reach the duration. if (elapsed > duration) elapsed = 0 // Increase the opacity from 0 slowly at first, then quickly. rect.opacity = inQuartCurve.valueForProgress(elapsed / duration) } }
構造化値型構文を使用してeasingCurve を作成することも可能です:
readonly property easingCurve inElasticCurve: ({ type: Easing.InElastic, amplitude: 4, period: 3 })
C++と統合する場合、C++からQMLに渡された QEasingCurve の値は自動的にeasingCurve の値に変換されることに注意してください。C++にeasingCurve の値を渡すと、自動的にQEasingCurve の値に変換されます。
デフォルトで構成されるeasingCurve はnew QtQml.easingCurve(QtQml.Easing.Linear) と等しくなります。
関連項目: QMLの値型。
© 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.