From c286afee3a817ffcfe0aba5fbe7c36cd791beda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@theqtcompany.com> Date: Tue, 10 Mar 2015 14:41:30 +0100 Subject: [PATCH] tst_QWindow::initialSize: Use showNormal() instead of show() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some platforms show() may result in the window being shown full screen, depending on the defaultWindowState of the platform. If that's the case, the resulting window size does not follow the requested size (though the internal normal geometry should). We need to use showNormal, so that we guarantee that the window state is WindowNoState. Change-Id: Ied080eaca13d759501ea292b5e6b2df4e3b32426 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 8ce0e3942e0..d361aa12a64 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -1464,7 +1464,7 @@ void tst_QWindow::initialSize() QSize defaultSize(0,0); { Window w; - w.show(); + w.showNormal(); QTRY_VERIFY(w.width() > 0); QTRY_VERIFY(w.height() > 0); defaultSize = QSize(w.width(), w.height()); @@ -1472,7 +1472,7 @@ void tst_QWindow::initialSize() { Window w; w.setWidth(m_testWindowSize.width()); - w.show(); + w.showNormal(); #if defined(Q_OS_BLACKBERRY) // "window" is the "root" window and will always be shown fullscreen // so we only expect one resize event QTRY_COMPARE(w.width(), qGuiApp->primaryScreen()->availableGeometry().width()); @@ -1485,7 +1485,7 @@ void tst_QWindow::initialSize() Window w; const QSize testSize(m_testWindowSize.width(), 42); w.resize(testSize); - w.show(); + w.showNormal(); #if defined(Q_OS_BLACKBERRY) // "window" is the "root" window and will always be shown fullscreen // so we only expect one resize event -- GitLab