diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-02-11 13:13:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-15 21:15:35 +0100 |
commit | 0bb6b65c56f49b93ca367f6771f10d3320dfc4f4 (patch) | |
tree | f6027a3613b98744287030426da83dff447c98fa | |
parent | 7d86eeb9d204ed1edcd0af87c37ba34bf7374ab0 (diff) |
Exclude widgets without associated QWindow in QApplication::shouldQuit().
Task-number: QTBUG-35986
Change-Id: Ibeb425fe054af163b86b2142028b3ea744cb9820
Reviewed-by: David Faure <david.faure@kdab.com>
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 3309b4be06..9bc1576dc6 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -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); } |