summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation/sub-attaq/states.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-07-13 20:39:05 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-08-17 09:51:32 +0200
commit13426aff248c25b44ac377f37dc3e3a54ea0ea86 (patch)
tree18dfc93c88f5a06460c9adddb681901711dacd30 /examples/widgets/animation/sub-attaq/states.h
parentcb3e1e551f340ce1e6280123d8b5411b3c1c96d8 (diff)
Cleanup QtWidgets animation examples
Cleanup the QtWidgets animation examples: - use nullptr - use normalized includes, remove unused includes - fix style - fix crash of sub-attaq when the game ended (error during range-based for loop porting) - don't use keyword 'final' for a variable name Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/animation/sub-attaq/states.h')
-rw-r--r--examples/widgets/animation/sub-attaq/states.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h
index cd68e319c2..b3651e1c82 100644
--- a/examples/widgets/animation/sub-attaq/states.h
+++ b/examples/widgets/animation/sub-attaq/states.h
@@ -52,15 +52,11 @@
#define STATES_H
//Qt
-#include <QtCore/QState>
-#include <QtCore/QSignalTransition>
-#include <QtCore/QPropertyAnimation>
-#include <QtWidgets/QKeyEventTransition>
-#include <QtCore/QSet>
+#include <QKeyEventTransition>
+#include <QSignalTransition>
+#include <QState>
class GraphicsScene;
-class Boat;
-class SubMarine;
QT_BEGIN_NAMESPACE
class QStateMachine;
QT_END_NAMESPACE
@@ -68,7 +64,7 @@ QT_END_NAMESPACE
class PlayState : public QState
{
public:
- explicit PlayState(GraphicsScene *scene, QState *parent = 0);
+ explicit PlayState(GraphicsScene *scene, QState *parent = nullptr);
~PlayState();
protected:
@@ -92,7 +88,7 @@ private :
class LevelState : public QState
{
public:
- LevelState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ LevelState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
private :
@@ -104,7 +100,7 @@ private :
class PauseState : public QState
{
public:
- explicit PauseState(GraphicsScene *scene, QState *parent = 0);
+ explicit PauseState(GraphicsScene *scene, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -116,7 +112,7 @@ private :
class LostState : public QState
{
public:
- LostState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ LostState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -129,7 +125,7 @@ private :
class WinState : public QState
{
public:
- WinState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ WinState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -154,7 +150,7 @@ public:
protected:
bool eventTest(QEvent *event) override;
private:
- PlayState * game;
+ PlayState *game;
GraphicsScene *scene;
};
@@ -166,7 +162,7 @@ public:
protected:
bool eventTest(QEvent *event) override;
private:
- PlayState * game;
+ PlayState *game;
GraphicsScene *scene;
};