RotationAnimator QML Type

RotationAnimator 유형은 아이템의 회전을 애니메이션합니다. 더 보기...

Import Statement: import QtQuick
Inherits:

Animator

속성

상세 설명

Animator 유형은 일반 애니메이션 유형과 다릅니다. 애니메이터를 사용하는 경우 렌더 스레드에서 애니메이션을 실행할 수 있으며 애니메이션이 완료되면 속성 값이 끝으로 이동합니다.

Item::rotation 값은 애니메이션이 완료된 후에 업데이트됩니다.

다음 스니펫은 회전 애니메이터를 직사각형 항목과 함께 사용하는 방법을 보여줍니다.

Rectangle {
    id: rotatingBox
    width: 50
    height: 50
    color: "lightsteelblue"
    RotationAnimator {
        target: rotatingBox;
        from: 0;
        to: 360;
        duration: 1000
        running: true
    }
}

on 키워드를 사용하여 회전 애니메이터를 아이템 인스턴스의 rotation 속성에 직접 연결할 수도 있습니다.

Rectangle {
    width: 50
    height: 50
    color: "lightsteelblue"
    RotationAnimator on rotation {
        from: 0;
        to: 360;
        duration: 1000
    }
}

Item::transformOriginScaleAnimator참조하세요 .

프로퍼티 문서

direction : enumeration

이 프로퍼티는 회전 방향을 저장합니다.

가능한 값은 다음과 같습니다:

Constant설명
RotationAnimator.Numerical(기본값) 두 숫자 사이를 선형 보간하여 회전합니다. 10에서 350까지 회전하면 시계 방향으로 340도 회전합니다.
RotationAnimator.Clockwise두 값 사이에서 시계 방향으로 회전
RotationAnimator.Counterclockwise두 값 사이를 시계 반대 방향으로 회전합니다.
RotationAnimator.Shortest가장 짧은 애니메이션 경로를 생성하는 방향으로 회전합니다. 10에서 350으로 회전하면 시계 반대 방향으로 20도 회전합니다.

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