easingCurve QML Value Type
イージングカーブを表す値。詳細...
| Import Statement: | import QtQml |
| Since: | Qt 6.11 |
詳細な説明
easingCurve 型は、easing curve を定義する属性を持つ値です:
enumeration typereal amplitudereal overshootreal periodlist<real> bezierCurve
これは、例えばFrameAnimation を使用したカスタムアニメーションを作成する場合や、指定されたカーブに沿って値のイージングを行う必要があるあらゆるユースケースで役立ちます。
easingCurve 値を作成するには、イージングタイプを割り当てます:
readonly property easingCurve inQuartCurve: 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 inQuartCurve: 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 はstructured value 型であるため、JavaScriptオブジェクトを使用して生成できます:
readonly property easingCurve inElasticCurve: ({
type: Easing.InElastic,
amplitude: 4,
period: 3
})C++ と統合する際は、C++ から QML に渡される QEasingCurve 値はすべて自動的にeasingCurve 値に変換される点に注意してください。easingCurve 値が C++ に渡されると、自動的に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.