diff options
Diffstat (limited to 'demos/sub-attaq')
27 files changed, 37 insertions, 36 deletions
diff --git a/demos/sub-attaq/animationmanager.cpp b/demos/sub-attaq/animationmanager.cpp index 13266f9..09a2a1b 100644 --- a/demos/sub-attaq/animationmanager.cpp +++ b/demos/sub-attaq/animationmanager.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/animationmanager.h b/demos/sub-attaq/animationmanager.h index 63ecae6..f48fe34 100644 --- a/demos/sub-attaq/animationmanager.h +++ b/demos/sub-attaq/animationmanager.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/boat.cpp b/demos/sub-attaq/boat.cpp index 68e646e..5799743 100644 --- a/demos/sub-attaq/boat.cpp +++ b/demos/sub-attaq/boat.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/boat.h b/demos/sub-attaq/boat.h index f6b1a90..b80f6dc 100644 --- a/demos/sub-attaq/boat.h +++ b/demos/sub-attaq/boat.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/boat_p.h b/demos/sub-attaq/boat_p.h index 4e962fc..5fcde62 100644 --- a/demos/sub-attaq/boat_p.h +++ b/demos/sub-attaq/boat_p.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/bomb.cpp b/demos/sub-attaq/bomb.cpp index e92a723..b047341 100644 --- a/demos/sub-attaq/bomb.cpp +++ b/demos/sub-attaq/bomb.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/bomb.h b/demos/sub-attaq/bomb.h index ed6b0f5..60d3fab 100644 --- a/demos/sub-attaq/bomb.h +++ b/demos/sub-attaq/bomb.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/custompropertyanimation.cpp b/demos/sub-attaq/custompropertyanimation.cpp index 9282f42..3975ce4 100644 --- a/demos/sub-attaq/custompropertyanimation.cpp +++ b/demos/sub-attaq/custompropertyanimation.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -96,7 +96,7 @@ void CustomPropertyAnimation::updateState(QAbstractAnimation::State oldState, QA setKeyValues(values); } - if (animProp && !startValue().isValid() && currentTime() == 0 + if ((animProp && !startValue().isValid() && currentTime() == 0) || (currentTime() == duration() && currentLoop() == (loopCount() - 1))) { setStartValue(def); } diff --git a/demos/sub-attaq/custompropertyanimation.h b/demos/sub-attaq/custompropertyanimation.h index a984163..7146887 100644 --- a/demos/sub-attaq/custompropertyanimation.h +++ b/demos/sub-attaq/custompropertyanimation.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/graphicsscene.cpp b/demos/sub-attaq/graphicsscene.cpp index fcbc1b3..210cb0e 100644 --- a/demos/sub-attaq/graphicsscene.cpp +++ b/demos/sub-attaq/graphicsscene.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/graphicsscene.h b/demos/sub-attaq/graphicsscene.h index 068ee97..1501db8 100644 --- a/demos/sub-attaq/graphicsscene.h +++ b/demos/sub-attaq/graphicsscene.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/main.cpp b/demos/sub-attaq/main.cpp index 4f6f4f9..e46a6d8 100644 --- a/demos/sub-attaq/main.cpp +++ b/demos/sub-attaq/main.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/mainwindow.cpp b/demos/sub-attaq/mainwindow.cpp index bcccd34..26cfc67 100644 --- a/demos/sub-attaq/mainwindow.cpp +++ b/demos/sub-attaq/mainwindow.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/mainwindow.h b/demos/sub-attaq/mainwindow.h index 08cfcd9..434b98c 100644 --- a/demos/sub-attaq/mainwindow.h +++ b/demos/sub-attaq/mainwindow.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/pixmapitem.cpp b/demos/sub-attaq/pixmapitem.cpp index ed0f075..5ab5583 100644 --- a/demos/sub-attaq/pixmapitem.cpp +++ b/demos/sub-attaq/pixmapitem.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/pixmapitem.h b/demos/sub-attaq/pixmapitem.h index e32973e..97d6f63 100644 --- a/demos/sub-attaq/pixmapitem.h +++ b/demos/sub-attaq/pixmapitem.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/progressitem.cpp b/demos/sub-attaq/progressitem.cpp index 9ccaa72..c20ebd0 100644 --- a/demos/sub-attaq/progressitem.cpp +++ b/demos/sub-attaq/progressitem.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/progressitem.h b/demos/sub-attaq/progressitem.h index 7be57c9..60873b6 100644 --- a/demos/sub-attaq/progressitem.h +++ b/demos/sub-attaq/progressitem.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/qanimationstate.cpp b/demos/sub-attaq/qanimationstate.cpp index 4e6df56..ccb788d 100644 --- a/demos/sub-attaq/qanimationstate.cpp +++ b/demos/sub-attaq/qanimationstate.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/qanimationstate.h b/demos/sub-attaq/qanimationstate.h index 6c5b565..cb605f3 100644 --- a/demos/sub-attaq/qanimationstate.h +++ b/demos/sub-attaq/qanimationstate.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp index d63737f..4cc4af9 100644 --- a/demos/sub-attaq/states.cpp +++ b/demos/sub-attaq/states.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -269,9 +269,10 @@ void UpdateScoreState::onEntry(QEvent *e) /** Win transition */ UpdateScoreTransition::UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target) - : QSignalTransition(scene,SIGNAL(subMarineDestroyed(int)), QList<QAbstractState*>() << target), + : QSignalTransition(scene,SIGNAL(subMarineDestroyed(int))), game(game), scene(scene) { + setTargetState(target); } bool UpdateScoreTransition::eventTest(QEvent *event) @@ -288,9 +289,10 @@ bool UpdateScoreTransition::eventTest(QEvent *event) /** Win transition */ WinTransition::WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target) - : QSignalTransition(scene,SIGNAL(allSubMarineDestroyed(int)), QList<QAbstractState*>() << target), + : QSignalTransition(scene,SIGNAL(allSubMarineDestroyed(int))), game(game), scene(scene) { + setTargetState(target); } bool WinTransition::eventTest(QEvent *event) diff --git a/demos/sub-attaq/states.h b/demos/sub-attaq/states.h index c3d81e7..22e7136 100644 --- a/demos/sub-attaq/states.h +++ b/demos/sub-attaq/states.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/submarine.cpp b/demos/sub-attaq/submarine.cpp index 029e04b..383005d 100644 --- a/demos/sub-attaq/submarine.cpp +++ b/demos/sub-attaq/submarine.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -111,7 +111,7 @@ SubMarine::SubMarine(int type, const QString &name, int points, QGraphicsItem * resize(pixmapItem->boundingRect().width(),pixmapItem->boundingRect().height()); setTransformOriginPoint(boundingRect().center()); - graphicsRotation = new QGraphicsRotation3D(this); + graphicsRotation = new QGraphicsRotation(this); graphicsRotation->setAxis(QVector3D(0, 1, 0)); graphicsRotation->setOrigin(QPointF(size().width()/2, size().height()/2)); QList<QGraphicsTransform *> r; diff --git a/demos/sub-attaq/submarine.h b/demos/sub-attaq/submarine.h index 564e9c6..1e33ba0 100644 --- a/demos/sub-attaq/submarine.h +++ b/demos/sub-attaq/submarine.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -76,7 +76,7 @@ public: virtual int type() const; - QGraphicsRotation3D *rotation3d() const { return graphicsRotation; } + QGraphicsRotation *rotation() const { return graphicsRotation; } signals: void subMarineDestroyed(); @@ -90,7 +90,7 @@ private: int speed; Movement direction; PixmapItem *pixmapItem; - QGraphicsRotation3D *graphicsRotation; + QGraphicsRotation *graphicsRotation; }; #endif //__SUBMARINE__H__ diff --git a/demos/sub-attaq/submarine_p.h b/demos/sub-attaq/submarine_p.h index c04b25b..520fe2f 100644 --- a/demos/sub-attaq/submarine_p.h +++ b/demos/sub-attaq/submarine_p.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -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); } diff --git a/demos/sub-attaq/torpedo.cpp b/demos/sub-attaq/torpedo.cpp index fe79488..8072cda 100644 --- a/demos/sub-attaq/torpedo.cpp +++ b/demos/sub-attaq/torpedo.cpp @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/sub-attaq/torpedo.h b/demos/sub-attaq/torpedo.h index c44037f..9c92040 100644 --- a/demos/sub-attaq/torpedo.h +++ b/demos/sub-attaq/torpedo.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ |