From 6cb8adb930926511777f8e97bc45683ecbbf5b36 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 28 Apr 2009 15:47:02 +0200 Subject: 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.) --- examples/statemachine/errorstate/mainwindow.cpp | 8 ++++---- 1 file 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(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)); } } -- cgit v0.12