From e3bdad13be9650d587fb18ff15122ebd3d09c194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 29 May 2017 13:20:11 +0200 Subject: [PATCH] Correctly set native widget window visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After d7a9e08f, calling QWindow::setVisible(true) is a no-op if the widget is already visible. Use QWidgetWindow::setNativeWindowVisibility() instead to set visibility for the native window directly. “Upgrading” widgets to be native widgets now works again. Change-Id: Id68dd8241f3afe00670c07e30e2b2ade9c150354 Task-number: QTBUG-61006 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b465ac36c7..b9aff2a58b 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1516,7 +1516,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO q->setAttribute(Qt::WA_OutsideWSRange, true); } else if (q->isVisible()) { // If widget is already shown, set window visible, too - win->setVisible(true); + QWidgetWindow *widgetWindow = qobject_cast(win); + widgetWindow->setNativeWindowVisibility(true); } }