summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-03-24 09:07:44 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-28 09:04:30 +0000
commit5903d9276c3085ab891ff874dacf9597879221d6 (patch)
tree1a60f2d2c345e416b82544c68801d652723e1bcf
parent9f6df74a672bb574d54eda1e6cfd5e2b9f1de372 (diff)
downloadqttools-5903d9276c3085ab891ff874dacf9597879221d6.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 Change-Id: I7439ee35bb07f448372fbf2f3943475db7095ac5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit e0dfb89e316811131e16e37022d65c6fadfd9bba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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());
}