diff options
authorSergio Martins <>2018-04-10 17:21:40 +0100
committerSérgio Martins <>2018-04-11 19:16:21 +0000
commit5de49ab4ed0aff4e89f234c0168f89c10263297c (patch)
parenta553e2f6b520525608412668a91b26ce68ca57cb (diff)
Fix grouped dock widget from shifting down when created
Animated .git attached to the bug report for easy understanding. Looks like we shouldn't set window flags after a setGeometry() and before having the window resources. If we do that, then the requested geometry won't be honoured. No idea if it can be fixable in the QPA and won't risk doing it there. Fixes the problem on macOS and Windows. On Linux it was OK, and still is. Task-number: QTBUG-67611 Change-Id: I8244b4956a5ac9afcf257bea762c2c3084b563f8 Reviewed-by: Olivier Goffart (Woboq GmbH) <>
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 2e773a5790..34ad88913d 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -467,6 +467,8 @@ void QDockWidgetGroupWindow::adjustFlags()
if (oldFlags != flags) {
+ if (!windowHandle())
+ create(); // The desired geometry is forgotten if we call setWindowFlags before having a window
const bool gainedNativeDecos = (oldFlags & Qt::FramelessWindowHint) && !(flags & Qt::FramelessWindowHint);
const bool lostNativeDecos = !(oldFlags & Qt::FramelessWindowHint) && (flags & Qt::FramelessWindowHint);