このページでは

Easing QML Type (Singleton)

イージングの列挙型および便利APIへのアクセスを提供します。詳細...

Import Statement: import QtQml
Since: Qt 6.11

注:この型は QML シングルトンです。QML エンジン内には、この型のインスタンスが 1 つしか存在しません。

詳細な説明

Easingシングルトンは、通常animations で使用されるEasing 列挙型へのアクセスを提供します。また、利便性向上のためのAPIとしてvalueForProgress 関数も提供します:

    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)
        }
    }

この関数の目的は、指定された曲線に沿って値にイージング効果を適用する便利な方法を提供することです。より高度な曲線については、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.