summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-03-24 09:07:44 +0100
committerMikoĊ‚aj Boc <Mikolaj.Boc@qt.io>2023-03-28 07:24:26 +0000
commite0dfb89e316811131e16e37022d65c6fadfd9bba (patch)
tree838082890d06b3cb5dac05bcaa2b573524d5bd2c
parent86d9ed958b269782c8365e94a098c7dba95e03ae (diff)
downloadqttools-e0dfb89e316811131e16e37022d65c6fadfd9bba.tar.gz
Compute initial size for assistant main window correctly
Resizing to 4/5 of screen dimensions was previously followed by calling adjustSize(), which immediately overrides the size assigned to the minimum size that accommodates child widgets. Reversing the calls makes us both not start outside the screen as intended and sets the correct size of 4/5 of screen real estate. Fixes: QTBUG-112220 Pick-to: 6.5 Change-Id: I7439ee35bb07f448372fbf2f3943475db7095ac5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/assistant/assistant/mainwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp
index b84addad7..4ed2f211a 100644
--- a/src/assistant/assistant/mainwindow.cpp
+++ b/src/assistant/assistant/mainwindow.cpp
@@ -193,9 +193,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
tabifyDockWidget(bookmarkDock, searchDock);
contentDock->raise();
const QRect screen = QGuiApplication::primaryScreen()->geometry();
- resize(4*screen.width()/5, 4*screen.height()/5);
-
adjustSize(); // make sure we won't start outside of the screen
+ resize(4 * screen.width() / 5, 4 * screen.height() / 5);
+
move(screen.center() - rect().center());
}