summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-29 09:22:35 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-29 09:22:35 (GMT)
commitcf9794278807c578bab2f3b015a99cc3adf20db5 (patch)
treee7eabaabeb3cddec781f1cc926e0c9b636ee4217 /examples/statemachine
parent6926197f1b817882fa074eecbe4f62f40e067642 (diff)
downloadQt-cf9794278807c578bab2f3b015a99cc3adf20db5.zip
Qt-cf9794278807c578bab2f3b015a99cc3adf20db5.tar.gz
Qt-cf9794278807c578bab2f3b015a99cc3adf20db5.tar.bz2
Adapt to recent API changes and bug fixes.
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/errorstate/mainwindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/statemachine/errorstate/mainwindow.cpp b/examples/statemachine/errorstate/mainwindow.cpp
index 9281298..f5edf60 100644
--- a/examples/statemachine/errorstate/mainwindow.cpp
+++ b/examples/statemachine/errorstate/mainwindow.cpp
@@ -117,6 +117,7 @@ void MainWindow::init()
m_machine->setGlobalRestorePolicy(QStateMachine::RestoreProperties);
QState *stoppedState = new QState(m_machine->rootState());
+ stoppedState->setObjectName("stoppedState");
stoppedState->assignProperty(runGameAction, "enabled", true);
stoppedState->assignProperty(stopGameAction, "enabled", false);
@@ -125,15 +126,18 @@ void MainWindow::init()
QState *spawnsAvailable = new QState(stoppedState);
spawnsAvailable->assignProperty(addTankAction, "enabled", true);
+ spawnsAvailable->setObjectName("spawnsAvailable");
QState *noSpawnsAvailable = new QState(stoppedState);
noSpawnsAvailable->assignProperty(addTankAction, "enabled", false);
spawnsAvailable->addTransition(this, SIGNAL(mapFull()), noSpawnsAvailable);
- QHistoryState *hs = stoppedState->addHistoryState();
+ QHistoryState *hs = new QHistoryState(stoppedState);
+ hs->setObjectName("hs");
hs->setDefaultState(spawnsAvailable);
- stoppedState->setInitialState(spawnsAvailable);
+
+ stoppedState->setInitialState(hs);
m_runningState = new QState(QState::ParallelGroup, m_machine->rootState());
m_runningState->assignProperty(addTankAction, "enabled", false);