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>
This commit is contained in:
parent
ee55244df4
commit
bb7bf6ca17
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user