Ensure Qt doesn't prevent quit due to ignored widget close events

This commit is contained in:
Ilya Fedin 2024-05-22 03:36:24 +04:00 committed by John Preston
parent 198528f79f
commit 5e3e9ba824
1 changed files with 4 additions and 1 deletions

View File

@ -255,7 +255,10 @@ void Sandbox::setupScreenScale() {
Sandbox::~Sandbox() = default;
bool Sandbox::event(QEvent *e) {
if (e->type() == QEvent::Quit && !Quitting()) {
if (e->type() == QEvent::Quit) {
if (Quitting()) {
return QCoreApplication::event(e);
}
Quit(QuitReason::QtQuitEvent);
e->ignore();
return false;