diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-04-28 13:47:02 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-04-28 13:47:02 (GMT) |
commit | 6cb8adb930926511777f8e97bc45683ecbbf5b36 (patch) | |
tree | 25daab595fa3240b0a3f4767944a379f9503a330 /examples/statemachine/errorstate/mainwindow.cpp | |
parent | 772cb8c46b96e850b391f157e4870895e53748d4 (diff) | |
download | Qt-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/errorstate/mainwindow.cpp')
-rw-r--r-- | examples/statemachine/errorstate/mainwindow.cpp | 8 |
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)); } } |