summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-01-28 14:53:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-25 16:09:50 +0100
commitbb7bf6ca17061d835cf7980179ae0a607830048d (patch)
tree99712f63f80e0505ee93fa240843e8e0f63ad385
parentee55244df4747712f953c448244c68ba3e95e31c (diff)
Make closeAllWindows() close real windows only.
QApplication::closeAllWindows() is documented to close all top-level windows. If the widget has WA_DontShowOnScreen set then that is a strong indication that this widget is, in fact, not a top-level window. [ChangeLog][QtWidgets][Mac] QWidgets embedded in QGraphicsProxyWidget are no longer sent close events when the app is closed. Task-number: QTBUG-33716 Change-Id: I0925ed67a2d2088ca9f950a4a43bc2729b88a86c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r--src/widgets/kernel/qapplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 9bc1576dc6..c01b535067 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1749,7 +1749,8 @@ bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows
QWidgetList list = QApplication::topLevelWidgets();
for (int i = 0; i < list.size(); ++i) {
QWidget *w = list.at(i);
- if (w->isVisible() && w->windowType() != Qt::Desktop && !w->data->is_closing) {
+ if (w->isVisible() && w->windowType() != Qt::Desktop &&
+ !w->testAttribute(Qt::WA_DontShowOnScreen) && !w->data->is_closing) {
QWindow *window = w->windowHandle();
if (!w->close()) // Qt::WA_DeleteOnClose may cause deletion.
return false;