diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-07-29 00:26:43 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2009-07-29 00:26:44 (GMT) |
commit | a6ea9ce6990003856ecadcca8ce9ddf37949363d (patch) | |
tree | 32bce99c4cf28cb922feca329f848ac0c5c47f42 /demos/sub-attaq/submarine_p.h | |
parent | 62d81d9955f39bac327affd703b9df006ee8f6f7 (diff) | |
download | Qt-a6ea9ce6990003856ecadcca8ce9ddf37949363d.zip Qt-a6ea9ce6990003856ecadcca8ce9ddf37949363d.tar.gz Qt-a6ea9ce6990003856ecadcca8ce9ddf37949363d.tar.bz2 |
Implement new transformation handling for graphics items.
The idea of having separate rotationX/Y/Z, shearX/Y, etc.
methods in QGraphicsItem turned out to be not giving us
the flexibility we need and wanted.
The new code now implements a different scheme, where we
keep simple rotate (around z-axis), scale and
transformOriginPoint methods, but remove the other ones.
Instead we now have an additional list of QGraphicsTransform
object. QGraphicsTransform is an abstract class that inherits
QObject. Several specializations are provided and can be
used to transform (and through property bindings animate)
the item.
Reviewed-By: Andreas
Diffstat (limited to 'demos/sub-attaq/submarine_p.h')
-rw-r--r-- | demos/sub-attaq/submarine_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/demos/sub-attaq/submarine_p.h b/demos/sub-attaq/submarine_p.h index e8df877..c04b25b 100644 --- a/demos/sub-attaq/submarine_p.h +++ b/demos/sub-attaq/submarine_p.h @@ -109,7 +109,7 @@ class ReturnState : public QAnimationState public: ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) { - returnAnimation = new QPropertyAnimation(submarine, "yRotation"); + returnAnimation = new QPropertyAnimation(submarine->rotation3d(), "angle"); AnimationManager::self()->registerAnimation(returnAnimation); setAnimation(returnAnimation); this->submarine = submarine; @@ -119,7 +119,7 @@ protected: void onEntry(QEvent *e) { returnAnimation->stop(); - returnAnimation->setStartValue(submarine->yRotation()); + returnAnimation->setStartValue(submarine->rotation3d()->angle()); returnAnimation->setEndValue(submarine->currentDirection() == SubMarine::Right ? 360. : 180.); returnAnimation->setDuration(500); QAnimationState::onEntry(e); |