quit event loop after closing main window if not started by an extern host application
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user