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 /demos/sub-attaq/submarine_p.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 'demos/sub-attaq/submarine_p.h')
-rw-r--r-- | demos/sub-attaq/submarine_p.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/demos/sub-attaq/submarine_p.h b/demos/sub-attaq/submarine_p.h index 1af820f..520fe2f 100644 --- a/demos/sub-attaq/submarine_p.h +++ b/demos/sub-attaq/submarine_p.h @@ -109,7 +109,8 @@ class ReturnState : public QAnimationState public: ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) { - returnAnimation = new QPropertyAnimation(submarine->rotation3d(), "angle"); + returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle"); + returnAnimation->setDuration(500); AnimationManager::self()->registerAnimation(returnAnimation); setAnimation(returnAnimation); this->submarine = submarine; @@ -119,9 +120,7 @@ protected: void onEntry(QEvent *e) { returnAnimation->stop(); - returnAnimation->setStartValue(submarine->rotation3d()->angle()); returnAnimation->setEndValue(submarine->currentDirection() == SubMarine::Right ? 360. : 180.); - returnAnimation->setDuration(500); QAnimationState::onEntry(e); } |