summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-13 09:01:32 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-13 09:01:32 (GMT)
commit288de11968d4b71c97fc5d1a175d4c4ac7023552 (patch)
tree1de83db15fd5cc200ff9e7e8baa231a32434f3e0
parent8589b7c526f8c7d436c6a7c3bfb39dc505eff78e (diff)
downloadQt-288de11968d4b71c97fc5d1a175d4c4ac7023552.zip
Qt-288de11968d4b71c97fc5d1a175d4c4ac7023552.tar.gz
Qt-288de11968d4b71c97fc5d1a175d4c4ac7023552.tar.bz2
doc: Correct names of snippets in docs for Tank Game example
-rw-r--r--doc/src/examples/tankgame.qdoc2
-rw-r--r--examples/statemachine/tankgame/mainwindow.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/src/examples/tankgame.qdoc b/doc/src/examples/tankgame.qdoc
index e10161c..1501a99 100644
--- a/doc/src/examples/tankgame.qdoc
+++ b/doc/src/examples/tankgame.qdoc
@@ -98,7 +98,7 @@
This is done by setting the error state of the plugin's top-most state to a special error state
defined specifically for the plugin in question.
- \snippet examples/statemachine/tankgame/mainwindow.cpp 3
+ \snippet examples/statemachine/tankgame/mainwindow.cpp 4
If a run-time error occurs in \c pluginState or any of its descendants, the state machine will
search the hierarchy of ancestors until it finds a state whose error state is different from
diff --git a/examples/statemachine/tankgame/mainwindow.cpp b/examples/statemachine/tankgame/mainwindow.cpp
index 3bc9bbe..870bc9c 100644
--- a/examples/statemachine/tankgame/mainwindow.cpp
+++ b/examples/statemachine/tankgame/mainwindow.cpp
@@ -135,8 +135,10 @@ void MainWindow::init()
spawnsAvailable->addTransition(this, SIGNAL(mapFull()), noSpawnsAvailable);
+//! [3]
QHistoryState *hs = new QHistoryState(stoppedState);
hs->setDefaultState(spawnsAvailable);
+//! [3]
stoppedState->setInitialState(hs);
@@ -255,9 +257,11 @@ void MainWindow::addTank()
// If the plugin has an error it is disabled
+//! [4]
QState *errorState = new QState(region);
errorState->assignProperty(tankItem, "enabled", false);
pluginState->setErrorState(errorState);
+//! [4]
}
}
}