diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-09-30 08:24:02 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-09-30 08:27:14 (GMT) |
commit | 4b4bea046f3a7e26f1c4bff97065a06b2d7f9dc1 (patch) | |
tree | cb5c59e651dce2ac7436fff7acf63527ecfdae53 /demos/sub-attaq | |
parent | 0c695b73f5bbc9122c8d3c61b883fa3f7fec7900 (diff) | |
download | Qt-4b4bea046f3a7e26f1c4bff97065a06b2d7f9dc1.zip Qt-4b4bea046f3a7e26f1c4bff97065a06b2d7f9dc1.tar.gz Qt-4b4bea046f3a7e26f1c4bff97065a06b2d7f9dc1.tar.bz2 |
Fix the sub-attaq menu (new game and quit).
Now QStateMachine can be a child of a QState but here in sub-attaq
the code was not design for that so the code breaks.
Task-number:QT-665
Task-number:QT-914
Reviewed-by:TrustMe
Diffstat (limited to 'demos/sub-attaq')
-rw-r--r-- | demos/sub-attaq/states.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp index 10c173e..7443ae7 100644 --- a/demos/sub-attaq/states.cpp +++ b/demos/sub-attaq/states.cpp @@ -67,6 +67,8 @@ PlayState::PlayState(GraphicsScene *scene, QState *parent) PlayState::~PlayState() { + if (machine) + delete machine; } void PlayState::onEntry(QEvent *) @@ -74,13 +76,15 @@ void PlayState::onEntry(QEvent *) //We are now playing? if (machine) { machine->stop(); + //we hide the information + scene->textInformationItem->hide(); scene->clearScene(); currentLevel = 0; score = 0; delete machine; } - machine = new QStateMachine(this); + machine = new QStateMachine; //This state is when player is playing LevelState *levelState = new LevelState(scene, this, machine); |