Qt 4.8
Rotation Class Reference

The Rotation object provides a way to rotate an Item. More...

Detailed Description

The Rotation object provides a way to rotate an Item.

Since
4.7

The Rotation object gives more control over rotation than using Item's rotation property. Specifically, it allows (z axis) rotation to be relative to an arbitrary point.

The following example rotates a Rectangle around its interior point 25, 25:

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

Rotation also provides a way to specify 3D-like rotations for Items. For these types of rotations you must specify the axis to rotate around in addition to the origin point.

The following example shows various 3D-like rotations applied to an Image .

import QtQuick 1.0
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 }
smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
smooth: true
}
}
axisrotation.png
See also
{declarative/ui-components/dialcontrol}{Dial Control example}, {declarative/toys/clocks}{Clocks example}

The documentation for this class was generated from the following file: