PathInterpolator QML Type

경로를 따라 수동으로 애니메이션을 적용하는 방법을 지정합니다. 더 보기...

Import Statement: import QtQuick

속성

자세한 설명

경로 보간기는 경로를 따라 특정 progress 에 대한 x, y, angle 정보를 제공합니다.

다음 예제에서는 베지어 경로를 따라 녹색 직사각형에 애니메이션을 적용합니다.

import QtQuick

Rectangle {
    width: 400
    height: 400

    PathInterpolator {
        id: motionPath

        path: Path {
            startX: 0; startY: 0

            PathCubic {
                x: 350; y: 350

                control1X: 350; control1Y: 0
                control2X: 0; control2Y: 350
            }
        }

        NumberAnimation on progress { from: 0; to: 1; duration: 2000 }
    }

    Rectangle {
        width: 50; height: 50
        color: "green"

        //bind our attributes to follow the path as progress changes
        x: motionPath.x
        y: motionPath.y
        rotation: motionPath.angle
    }
}

속성 문서

x : real [read-only]

y : real [read-only]

이 속성은 progress 에서 경로의 위치를 유지합니다.


angle : real [read-only]

이 속성은 progress 에 접하는 경로의 각도를 유지합니다.

각도는 시계 방향으로 보고되며 3시 위치는 0도입니다.


path : Path

이 속성은 보간할 경로를 보유합니다.

경로 정의에 대한 자세한 내용은 Path 문서를 참조하세요.


progress : real

이 속성은 경로를 따라 현재 진행 상황을 저장합니다.

PathInterpolator 의 일반적인 사용법은 진행률( NumberAnimation)을 설정하고 x, y 및 각도에 해당하는 값을 읽는 것입니다(이러한 값에 바인딩하는 경우가 많음).

진행률 범위는 0.0에서 1.0까지입니다.


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