close all top-level widgets when about to quit event loop

This commit is contained in:
wmayer
2018-09-10 12:32:14 +02:00
parent a624fee2c2
commit 3b9a9e02bc

View File

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