summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-28 13:47:02 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-28 13:47:02 (GMT)
commit6cb8adb930926511777f8e97bc45683ecbbf5b36 (patch)
tree25daab595fa3240b0a3f4767944a379f9503a330 /examples/statemachine
parent772cb8c46b96e850b391f157e4870895e53748d4 (diff)
downloadQt-6cb8adb930926511777f8e97bc45683ecbbf5b36.zip
Qt-6cb8adb930926511777f8e97bc45683ecbbf5b36.tar.gz
Qt-6cb8adb930926511777f8e97bc45683ecbbf5b36.tar.bz2
Work around an oddity in parallel states that causes all regions to exit
if there is a transition from one of them (even if the target state of the transition is inside the region.)
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/errorstate/mainwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/statemachine/errorstate/mainwindow.cpp b/examples/statemachine/errorstate/mainwindow.cpp
index c0af62d..9281298 100644
--- a/examples/statemachine/errorstate/mainwindow.cpp
+++ b/examples/statemachine/errorstate/mainwindow.cpp
@@ -192,8 +192,7 @@ void MainWindow::addTank()
{
Q_ASSERT(!m_spawns.isEmpty());
- QString fileName = QFileDialog::getOpenFileName(this, "Select plugin file",
- "plugins/", "*.dll");
+ QString fileName = QFileDialog::getOpenFileName(this, "Select plugin file", "plugins/", "*.dll");
QPluginLoader loader(fileName);
Plugin *plugin = qobject_cast<Plugin *>(loader.instance());
@@ -203,8 +202,9 @@ void MainWindow::addTank()
connect(tankItem, SIGNAL(fireCannon()), this, SLOT(addRocket()));
if (m_spawns.isEmpty())
emit mapFull();
-
- plugin->create(m_runningState, tankItem);
+
+ QState *region = new QState(m_runningState);
+ region->setInitialState(plugin->create(region, tankItem));
}
}