summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
commit015002fec9abff6a4c1bb3fa4b9de87279a079c3 (patch)
treead93af535a503d0a49d6c6367e990a8fbca163d3 /tests/auto/gui
parentf1e00262321cc8daa3c7506153653453e2779886 (diff)
parentb9547af45ea2bbbc634722c1ef41afdb54216ce2 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp35
1 files changed, 12 insertions, 23 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 7a0683c3bf..1f6bcbd341 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -250,17 +250,11 @@ void tst_QWindow::resizeEventAfterResize()
void tst_QWindow::positioning_data()
{
QTest::addColumn<int>("windowflags");
- QTest::addColumn<int>("resizecount");
- QTest::newRow("default") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint)
-#if defined(Q_OS_OSX) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
- << 4;
-#else
- << 3;
-#endif
+ QTest::newRow("default") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint);
#ifdef Q_OS_OSX
- QTest::newRow("fake") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint) << 4;
+ QTest::newRow("fake") << int(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
#endif
}
@@ -279,7 +273,6 @@ void tst_QWindow::positioning()
const QRect geometry(m_availableTopLeft + QPoint(80, 80), m_testWindowSize);
QFETCH(int, windowflags);
- QFETCH(int, resizecount);
Window window((Qt::WindowFlags)windowflags);
window.setGeometry(QRect(m_availableTopLeft + QPoint(20, 20), m_testWindowSize));
window.setFramePosition(m_availableTopLeft + QPoint(40, 40)); // Move window around before show, size must not change.
@@ -290,8 +283,7 @@ void tst_QWindow::positioning()
window.showNormal();
QCoreApplication::processEvents();
- QTRY_COMPARE(window.received(QEvent::Resize), 1);
- QTRY_VERIFY(window.received(QEvent::Expose) > 0);
+ QTest::qWaitForWindowExposed(&window);
QMargins originalMargins = window.frameMargins();
@@ -301,25 +293,22 @@ void tst_QWindow::positioning()
QPoint originalPos = window.position();
QPoint originalFramePos = window.framePosition();
+ window.reset();
window.setWindowState(Qt::WindowFullScreen);
QCoreApplication::processEvents();
-#if defined(Q_OS_BLACKBERRY) // "window" is the "root" window and will always be shown fullscreen
- // so we only expect one resize event
- Q_UNUSED(resizecount);
- QTRY_COMPARE(window.received(QEvent::Resize), 1);
-#else
- QTRY_COMPARE(window.received(QEvent::Resize), 2);
+ // On BB10 the window is the root window and fullscreen, so nothing is resized.
+#if !defined(Q_OS_BLACKBERRY)
+ QTRY_VERIFY(window.received(QEvent::Resize) > 0);
#endif
QTest::qWait(2000);
+ window.reset();
window.setWindowState(Qt::WindowNoState);
QCoreApplication::processEvents();
-#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(window.received(QEvent::Resize), 1);
-#else
- QTRY_COMPARE(window.received(QEvent::Resize), resizecount);
+ // On BB10 the window is the root window and fullscreen, so nothing is resized.
+#if !defined(Q_OS_BLACKBERRY)
+ QTRY_VERIFY(window.received(QEvent::Resize) > 0);
#endif
QTRY_COMPARE(originalPos, window.position());
@@ -329,7 +318,7 @@ void tst_QWindow::positioning()
// if our positioning is actually fully respected by the window manager
// test whether it correctly handles frame positioning as well
if (originalPos == geometry.topLeft() && (originalMargins.top() != 0 || originalMargins.left() != 0)) {
- QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().topLeft() + QPoint(40, 40);
+ QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center();
window.reset();
window.setFramePosition(framePos);