diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-12 10:40:30 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-12 10:42:20 (GMT) |
commit | e780030ca6990e73444646e6deae48145ca49972 (patch) | |
tree | 91ebea829ba4d71a7863be5401fab7fc9f46f894 /src/gui/graphicsview/qgraphicstransform.h | |
parent | 031004dba57bff8eed8cdd0cd4c9ce44c9c36fd8 (diff) | |
download | Qt-e780030ca6990e73444646e6deae48145ca49972.zip Qt-e780030ca6990e73444646e6deae48145ca49972.tar.gz Qt-e780030ca6990e73444646e6deae48145ca49972.tar.bz2 |
QGraphicsRotation and QGraphicsRotation3D are now merged into 1 class
You can now also set the axis following hte Qt::Axis enum
Note: I'm not 100% sure about the maths in QGraphicsRotation::applyTo
Feel free to fix it.
Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/graphicsview/qgraphicstransform.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicstransform.h | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/gui/graphicsview/qgraphicstransform.h b/src/gui/graphicsview/qgraphicstransform.h index 2e0d511..8ccc258 100644 --- a/src/gui/graphicsview/qgraphicstransform.h +++ b/src/gui/graphicsview/qgraphicstransform.h @@ -117,6 +117,7 @@ class Q_GUI_EXPORT QGraphicsRotation : public QGraphicsTransform Q_PROPERTY(QPointF origin READ origin WRITE setOrigin NOTIFY originChanged) Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged) + Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged) public: QGraphicsRotation(QObject *parent = 0); ~QGraphicsRotation(); @@ -127,39 +128,19 @@ public: qreal angle() const; void setAngle(qreal); - void applyTo(QTransform *transform) const; - -Q_SIGNALS: - void originChanged(); - void angleChanged(); - -protected: - QGraphicsRotation(QGraphicsRotationPrivate &p, QObject *parent); -private: - Q_DECLARE_PRIVATE(QGraphicsRotation) -}; - -class QGraphicsRotation3DPrivate; - -class Q_GUI_EXPORT QGraphicsRotation3D : public QGraphicsRotation -{ - Q_OBJECT - - Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged) -public: - QGraphicsRotation3D(QObject *parent = 0); - ~QGraphicsRotation3D(); - - QVector3D axis(); + QVector3D axis() const; void setAxis(const QVector3D &axis); + void setAxis(Qt::Axis axis); void applyTo(QTransform *transform) const; Q_SIGNALS: + void originChanged(); + void angleChanged(); void axisChanged(); private: - Q_DECLARE_PRIVATE(QGraphicsRotation3D) + Q_DECLARE_PRIVATE(QGraphicsRotation) }; QT_END_NAMESPACE |