diff options
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)); } } |