Rotation QML Type

항목을 회전하는 방법을 제공합니다. 더 보기...

Import Statement: import QtQuick

속성

상세 설명

회전 유형은 회전 유형 트랜스폼을 통해 Item 을 회전하는 방법을 제공합니다.

(z축) 회전이 임의의 지점을 기준으로 할 수 있으며, 아이템에 3D와 같은 회전을 지정할 수 있는 방법도 제공합니다. 이는 rotation 속성보다 아이템 회전을 더 세밀하게 제어할 수 있습니다.

다음 예제는 직사각형을 내부 지점(25, 25)을 중심으로 회전합니다:

Rectangle {
    width: 100; height: 100
    color: "blue"
    transform: Rotation { origin.x: 25; origin.y: 25; angle: 45}
}

3D와 유사한 항목 회전의 경우 원점 외에 회전 축을 지정해야 합니다. 다음 예는 Image 에 적용된 다양한 3D와 유사한 회전을 보여줍니다.

import QtQuick

Row {
    x: 10; y: 10
    spacing: 10

    Image { source: "pics/qt.png" }
    Image {
        source: "pics/qt.png"
        transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
    }
    Image {
        source: "pics/qt.png"
        transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
    }
    Image {
        source: "pics/qt.png"
        transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
    }
    Image {
        source: "pics/qt.png"
        transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
    }
}

다이얼 컨트롤 예제Qt Quick 데모 - 시계도참조하세요 .

속성 문서

angle : real

회전할 각도(시계 방향도)입니다.


axis group

axis.x : real

axis.y : real

axis.z : real

회전할 축. 회전할 축입니다. 점을 중심으로 단순(2D) 회전하는 경우 기본 축은 z 축이므로 축을 지정할 필요가 없습니다(axis { x: 0; y: 0; z: 1 }).

일반적인 3D와 같은 회전의 경우 일반적으로 원점과 축을 모두 지정합니다.


origin group

origin.x : real

origin.y : real

회전의 원점(즉, 항목의 나머지 부분이 회전할 때 부모를 기준으로 고정된 상태로 유지되는 지점)을 지정합니다. 기본적으로 원점은 (0, 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.