CopperSpice API  1.9.1
QGraphicsRotation Class Reference

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

Inheritance diagram for QGraphicsRotation:
QGraphicsTransform QObject

Public Signals

void angleChanged ()
 
void axisChanged ()
 
void originChanged ()
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Methods

 QGraphicsRotation (QObject *parent=nullptr)
 
 ~QGraphicsRotation ()
 
qreal angle () const
 
void applyTo (QMatrix4x4 *matrix) const override
 
QVector3D axis () const
 
QVector3D origin () const
 
void setAngle (qreal value)
 
void setAxis (const QVector3D &axis)
 
void setAxis (Qt::Axis axis)
 
void setOrigin (const QVector3D &point)
 
- Public Methods inherited from QGraphicsTransform
 QGraphicsTransform (QObject *parent=nullptr)
 
 ~QGraphicsTransform ()
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Properties

 angle
 
 axis
 
 origin
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Slots inherited from QGraphicsTransform
void update ()
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The QGraphicsRotation class provides a rotation transformation around a given axis. This class has various parameters to help control how the rotation should be applied.

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. 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.

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, QGraphicsItem::setRotation(), QTransform::rotate()

Constructor & Destructor Documentation

QGraphicsRotation::QGraphicsRotation ( QObject parent = nullptr)

Constructs a new QGraphicsRotation with the given parent.

QGraphicsRotation::~QGraphicsRotation ( )

Destroys the graphics rotation.

Method Documentation

qreal QGraphicsRotation::angle ( ) const

Returns the value of the property.

void QGraphicsRotation::angleChanged ( )
signal

This signal is emitted whenever the angle has changed.

See also
QGraphicsRotation::angle
void QGraphicsRotation::applyTo ( QMatrix4x4 matrix) const
overridevirtual
QVector3D QGraphicsRotation::axis ( ) const

Returns the value of the property.

void QGraphicsRotation::axisChanged ( )
signal

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

See also
QGraphicsRotation::axis
QVector3D QGraphicsRotation::origin ( ) const

Returns the value of the property.

void QGraphicsRotation::originChanged ( )
signal

This signal is emitted whenever the origin has changed.

See also
QGraphicsRotation::origin
void QGraphicsRotation::setAngle ( qreal  value)

Sets the value of the property to value.

void QGraphicsRotation::setAxis ( const QVector3D axis)

Sets the value of the property to axis.

void QGraphicsRotation::setAxis ( Qt::Axis  axis)

Sets the value of the property to axis.

void QGraphicsRotation::setOrigin ( const QVector3D point)

Sets the value of the property to point.

Property Documentation

QGraphicsRotation::angle

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) however it is permissible to provide values outside of this range. For example, an angle of 370 degrees gives the same result as 10 degrees. Setting the angle to NaN results in no rotation.

See also
origin
PropertiesClass Methods
read angle
write setAngle
notify angleChanged
QGraphicsRotation::axis

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, 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.

See also
QTransform, QGraphicsRotation::angle
PropertiesClass Methods
read axis
write setAxis
notify axisChanged
QGraphicsRotation::origin

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).

See also
angle
PropertiesClass Methods
read origin
write setOrigin
notify originChanged