diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-04-29 09:22:35 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-04-29 09:22:35 (GMT) |
commit | cf9794278807c578bab2f3b015a99cc3adf20db5 (patch) | |
tree | e7eabaabeb3cddec781f1cc926e0c9b636ee4217 | |
parent | 6926197f1b817882fa074eecbe4f62f40e067642 (diff) | |
download | Qt-cf9794278807c578bab2f3b015a99cc3adf20db5.zip Qt-cf9794278807c578bab2f3b015a99cc3adf20db5.tar.gz Qt-cf9794278807c578bab2f3b015a99cc3adf20db5.tar.bz2 |
Adapt to recent API changes and bug fixes.
-rw-r--r-- | examples/statemachine/errorstate/mainwindow.cpp | 8 |
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); |