En esta página

Easing QML Type (Singleton)

Proporciona acceso a los enums de easing y a la API de conveniencia. Más...

Import Statement: import QtQml
Since: Qt 6.11

Nota: Este tipo es un singleton QML. Sólo hay una instancia de este tipo en el motor QML.

Descripción detallada

El singleton Easing proporciona acceso al enum Easing, que suele ser utilizado por animations. También proporciona la función valueForProgress como API de conveniencia:

    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.

        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 = Easing.valueForProgress(Easing.InQuart, elapsed / duration)
        }
    }

El objetivo de esta función es ofrecer una manera conveniente de facilitar un valor a lo largo de una curva dada. Para curvas más avanzadas, utilice el tipo de valor easingCurve.

© 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.