quit event loop after closing main window if not started by an extern host application

This commit is contained in:
wmayer
2018-08-09 17:03:01 +02:00
parent 34172c851c
commit 1d83e15e3f
2 changed files with 3 additions and 1 deletions

View File

@@ -1722,6 +1722,7 @@ void Application::runApplication(void)
Application app(true);
MainWindow mw;
mw.setProperty("QuitOnClosed", true);
// allow to disable version number
ParameterGrp::handle hGen = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General");

View File

@@ -976,7 +976,8 @@ void MainWindow::closeEvent (QCloseEvent * e)
}
/*emit*/ mainWindowClosed();
qApp->quit(); // stop the event loop
if (this->property("QuitOnClosed").isValid())
qApp->quit(); // stop the event loop
}
}