diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-10-22 13:01:38 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-10-31 08:53:41 +0000 |
commit | 40b33adb7ab5d0295fa95cf66a8d3f59c8d11739 (patch) | |
tree | dc832a05783f4c5a504a97e19b4d696395355a30 /src/widgets/kernel/qwidget.cpp | |
parent | 15f29c3a24fc8c29acfac3da7aed408d165f680e (diff) |
Ensure that child windows are visible again when showing their parent
When a window is closed, then it will cause the child windows to be
closed as well as a result. Therefore in order to ensure that they are
shown again as a result, we need to remove the WA_WState_ExplicitShowHide
attribute if the widget was not already hidden before. This enables us to
test for this attribute when calling showChildren(), so that if the
window has a windowHandle then we can make sure that this widget is shown
again.
Fixes: QTBUG-73021
Change-Id: I1186242b889899dfcd38d782a67567348e2055ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ccd3bf0871b81dfc09bb469b161f32dfb47ee53e)
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f5cc6bb853..db08a1d04f 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. @@ -8445,6 +8445,8 @@ void QWidgetPrivate::showChildren(bool spontaneous) QList<QObject*> childList = children; for (int i = 0; i < childList.size(); ++i) { QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); + if (widget && widget->windowHandle() && !widget->testAttribute(Qt::WA_WState_ExplicitShowHide)) + widget->setAttribute(Qt::WA_WState_Hidden, false); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) |