Rotation QML Type
항목을 회전하는 방법을 제공합니다. 더 보기...
| Import Statement: | import QtQuick |
속성
- angle : real
- axis
- distanceToPlane : real
(since 6.11) - origin
상세 설명
Rotation 유형은 회전형 변환을 통해 Item 를 회전시키는 방법을 제공합니다.
이를 통해 임의의 점을 기준으로 (z축) 회전을 수행할 수 있으며, 아이템에 대해 3D와 유사한 회전을 지정할 수 있는 방법도 제공합니다. 이는 rotation 속성보다 아이템 회전을 더 정밀하게 제어할 수 있게 해줍니다.
다음 예제는 Rectangle을 내부 점(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: "images/qt-logo.png" }
Image {
source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
}
Image {
source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
}
Image {
source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
}
Image {
source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
}
}
‘다이얼 컨트롤’ 예제 및 ‘Qt Quick 데모 - 시계’도 참조하십시오 .
속성 설명서
angle : real
시계 방향으로 회전할 각도(도).
axis group
회전할 축입니다. 점 주위의 간단한 (2D) 회전의 경우, 기본 축이 z축이므로(axis { x: 0; y: 0; z: 1 }) 축을 별도로 지정할 필요가 없습니다.
일반적인 3D와 유사한 회전의 경우, 대개 원점과 축을 모두 지정하게 됩니다.

distanceToPlane : real [since 6.11]
이 속성은 투시 투영 모델에서 시야면(가상 화면)과 관찰자 사이의 거리를 정의합니다.
거리가 짧을수록 원근 효과가 더 강해져, 물체가 회전할 때 더 극적으로 멀어지거나 가까워지는 것처럼 보입니다. 값이 클수록 원근 왜곡이 덜 눈에 띄는, 더 평평하고 정투영에 가까운 모양이 나타납니다.
기본값은 1024.0 이며, 이는 대부분의 사용 사례에 적합한 적당한 원근감을 제공합니다.
이 속성이 0 로 설정되면 원근 투영이 적용되지 않습니다. 이 경우, QMatrix4x4::rotate()로 정의된 변환을 사용하여 3D 공간에서 직접 회전이 수행됩니다.
이 속성은 x축 및 y축을 중심으로 한 회전에만 영향을 미칩니다. z축을 중심으로 한 회전(2D 회전)은 이 속성의 영향을 받지 않습니다.
이 속성은 Qt 6.11에서 도입되었습니다.
origin group
회전의 원점(즉, 항목의 나머지 부분이 회전할 때 부모 요소에 대해 고정된 상태로 유지되는 점). 기본적으로 원점은 (0, 0)입니다.
© 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.