summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 69c76112f6..e3563dc301 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -78,10 +78,13 @@ public:
// explicitly and not because the parent window in this case made it hidden.
// In which case do not automatically show the widget when the parent
// window is shown.
+ const bool wasExplicitShowHide = widget->testAttribute(Qt::WA_WState_ExplicitShowHide);
const bool wasHidden = widget->testAttribute(Qt::WA_WState_Hidden);
QWidgetPrivate::get(widget)->setVisible(visible);
- if (!wasHidden)
- widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false);
+ if (wasExplicitShowHide) {
+ widget->setAttribute(Qt::WA_WState_ExplicitShowHide, wasExplicitShowHide);
+ widget->setAttribute(Qt::WA_WState_Hidden, wasHidden);
+ }
} else {
QWindowPrivate::setVisible(visible);
}