|  | Home · All Classes · Modules

# QGraphicsRotation Class Reference
[QtGui module]

The QGraphicsRotation class provides a rotation transformation around a given axis. More...

Inherits QGraphicsTransform.

### Methods

- __init__ (self, QObject parent = None)
- float angle (self)
- applyTo (self, QMatrix4x4 matrix)
- QVector3D axis (self)
- QVector3D origin (self)
- setAngle (self, float)
- setAxis (self, QVector3D axis)
- setAxis (self, Qt.Axis axis)
- setOrigin (self, QVector3D point)

### Qt Signals

- void angleChanged ()
- void axisChanged ()
- void originChanged ()

## Detailed Description

The QGraphicsRotation class provides a rotation transformation around a given axis.

You can provide the desired axis by assigning a QVector3D to the axis property or by passing a member if Qt.Axis to the setAxis convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis.

The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis.

QGraphicsRotation provides certain parameters to help control how the rotation should be applied.

The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is QPointF(0, 0).

The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times.

Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis.

## Method Documentation

### QGraphicsRotation.__init__ (self, QObject parent = None)

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Constructs a new QGraphicsRotation with the given parent.

### float QGraphicsRotation.angle (self)

### QGraphicsRotation.applyTo (self, QMatrix4x4 matrix)

Reimplemented from QGraphicsTransform.applyTo().

### QVector3D QGraphicsRotation.axis (self)

### QVector3D QGraphicsRotation.origin (self)

### QGraphicsRotation.setAngle (self, float)

### QGraphicsRotation.setAxis (self, QVector3D axis)

### QGraphicsRotation.setAxis (self, Qt.Axis axis)

### QGraphicsRotation.setOrigin (self, QVector3D point)

## Qt Signal Documentation

### void angleChanged ()

This is the default overload of this signal.

This signal is emitted whenever the angle has changed.

See also QGraphicsRotation.angle.

### void axisChanged ()

This is the default overload of this signal.

This signal is emitted whenever the axis of the object changes.

See also QGraphicsRotation.axis.

### void originChanged ()

This is the default overload of this signal.

This signal is emitted whenever the origin has changed.

See also QGraphicsRotation.origin.