Exclude widgets without associated QWindow in QApplication::shouldQuit().

Task-number: QTBUG-35986

Change-Id: Ibeb425fe054af163b86b2142028b3ea744cb9820
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Friedemann Kleint 2014-02-11 13:13:37 +01:00 committed by The Qt Project
parent 7d86eeb9d2
commit 0bb6b65c56

View File

@ -2743,9 +2743,11 @@ bool QApplicationPrivate::shouldQuit()
QWindowList processedWindows;
for (int i = 0; i < list.size(); ++i) {
QWidget *w = list.at(i);
processedWindows.push_back(w->windowHandle());
if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose))
return false;
if (QWindow *window = w->windowHandle()) { // Menus, popup widgets may not have a QWindow
processedWindows.push_back(window);
if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose))
return false;
}
}
return QGuiApplicationPrivate::shouldQuitInternal(processedWindows);
}