easingCurve QML Value Type
Value that represents an easing curve. More...
| Since: | Qt 6.11 |
Detailed Description
The easingCurve type is a value with attributes that define an easing curve:
enumeration typereal amplitudereal overshootreal periodlist<real> bezierCurve
It is useful when doing custom animations with FrameAnimation, for example, or in any use case that requires easing a value along a given curve.
To create an easingCurve value, assign an easing type:
readonly property easingCurve inQuartCurve: Easing.InQuartThe following example is similar to the one described by the documentation of 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)
}
}As easingCurve is a structured value type, it can be constructed with a JavaScript object:
readonly property easingCurve inElasticCurve: ({
type: Easing.InElastic,
amplitude: 4,
period: 3
})When integrating with C++, note that any QEasingCurve value passed into QML from C++ is automatically converted into an easingCurve value. When an easingCurve value is passed to C++, it is automatically converted into a QEasingCurve value.
A default-constructed easingCurve is equal to new QtQml.easingCurve(QtQml.Easing.Linear).
See also QML Value Types.
© 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.