QGraphicsRotation

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

Inheritance diagram of PySide6.QtWidgets.QGraphicsRotation

New in version 4.6.

Synopsis

Functions

Detailed Description

You can provide the desired axis by assigning a QVector3D to the axis property or by passing a member if 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.

See also

QGraphicsTransform setRotation() rotate()

class PySide6.QtWidgets.QGraphicsRotation([parent=None])
Parameters

parentPySide6.QtCore.QObject

Constructs a new QGraphicsRotation with the given parent.

PySide6.QtWidgets.QGraphicsRotation.angle()
Return type

float

See also

setAngle()

PySide6.QtWidgets.QGraphicsRotation.angleChanged()
PySide6.QtWidgets.QGraphicsRotation.axis()
Return type

PySide6.QtGui.QVector3D

See also

setAxis()

PySide6.QtWidgets.QGraphicsRotation.axisChanged()
PySide6.QtWidgets.QGraphicsRotation.origin()
Return type

PySide6.QtGui.QVector3D

See also

setOrigin()

PySide6.QtWidgets.QGraphicsRotation.originChanged()
PySide6.QtWidgets.QGraphicsRotation.setAngle(arg__1)
Parameters

arg__1 – float

See also

angle()

PySide6.QtWidgets.QGraphicsRotation.setAxis(axis)
Parameters

axisAxis

PySide6.QtWidgets.QGraphicsRotation.setAxis(axis)
Parameters

axisPySide6.QtGui.QVector3D

PySide6.QtWidgets.QGraphicsRotation.setOrigin(point)
Parameters

pointPySide6.QtGui.QVector3D

See also

origin()