• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QGraphicsTransform

    下一话题

    QGraphicsScale

    QGraphicsRotation

    注意

    该类在 Qt4.6 引入

    概要

    函数

    详细描述

    PySide.QtGui.QGraphicsRotation class provides a rotation transformation around a given axis.

    You can provide the desired axis by assigning a PySide.QtGui.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 PySide.QtGui.QGraphicsRotation , now describes the number of degrees to rotate around this axis.

    PySide.QtGui.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 PySide.QtCore.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 PySide.QtGui. QGraphicsRotation ( [ parent=None ] )
    参数: parent PySide.QtCore.QObject

    构造新 PySide.QtGui.QGraphicsRotation 采用给定 parent .

    PySide.QtGui.QGraphicsRotation. angle ( )
    返回类型: PySide.QtCore.qreal

    This property holds the angle for clockwise rotation, in degrees..

    The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.

    PySide.QtGui.QGraphicsRotation. angleChanged ( )
    PySide.QtGui.QGraphicsRotation. axis ( )
    返回类型: PySide.QtGui.QVector3D

    This property holds a rotation axis, specified by a vector in 3D space..

    This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, PySide.QtGui.QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

    PySide.QtGui.QGraphicsRotation. axisChanged ( )
    PySide.QtGui.QGraphicsRotation. origin ( )
    返回类型: PySide.QtGui.QVector3D

    This property holds the origin of the rotation in 3D space..

    All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).

    PySide.QtGui.QGraphicsRotation. originChanged ( )
    PySide.QtGui.QGraphicsRotation. setAngle ( arg__1 )
    参数: arg__1 PySide.QtCore.qreal

    This property holds the angle for clockwise rotation, in degrees..

    The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.

    PySide.QtGui.QGraphicsRotation. setAxis ( axis )
    参数: axis PySide.QtGui.QVector3D

    This property holds a rotation axis, specified by a vector in 3D space..

    This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, PySide.QtGui.QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

    PySide.QtGui.QGraphicsRotation. setAxis ( axis )
    参数: axis PySide.QtCore.Qt.Axis
    PySide.QtGui.QGraphicsRotation. setOrigin ( point )
    参数: point PySide.QtGui.QVector3D

    This property holds the origin of the rotation in 3D space..

    All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).