内容表

上一话题

QGraphicsRectItem

下一话题

QGraphicsScale

QGraphicsRotation

QGraphicsRotation class provides a rotation transformation around a given axis. 更多

Inheritance diagram of PySide2.QtWidgets.QGraphicsRotation

4.6 版新增。

概要

函数

详细描述

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

class QGraphicsRotation ( [ parent=None ] )
param parent

QObject

构造新 QGraphicsRotation 采用给定 parent .

PySide2.QtWidgets.QGraphicsRotation. angle ( )
返回类型

qreal

另请参阅

setAngle()

PySide2.QtWidgets.QGraphicsRotation. angleChanged ( )
PySide2.QtWidgets.QGraphicsRotation. axis ( )
返回类型

QVector3D

另请参阅

setAxis()

PySide2.QtWidgets.QGraphicsRotation. axisChanged ( )
PySide2.QtWidgets.QGraphicsRotation. origin ( )
返回类型

QVector3D

另请参阅

setOrigin()

PySide2.QtWidgets.QGraphicsRotation. originChanged ( )
PySide2.QtWidgets.QGraphicsRotation. setAngle ( arg__1 )
参数

arg__1 qreal

另请参阅

angle()

PySide2.QtWidgets.QGraphicsRotation. setAxis ( axis )
参数

axis Axis

Convenience function to set the axis to axis .

Note: the YAxis rotation for QTransform is inverted from the correct mathematical rotation in 3D space. The QGraphicsRotation class implements a correct mathematical rotation. The following two sequences of code will perform the same transformation:

QTransform t;
t.rotate(45, Qt::YAxis);
QGraphicsRotation r;
r.setAxis(Qt::YAxis);
r.setAngle(-45);
											
PySide2.QtWidgets.QGraphicsRotation. setAxis ( axis )
参数

axis QVector3D

PySide2.QtWidgets.QGraphicsRotation. setOrigin ( point )
参数

point QVector3D

另请参阅

origin()