diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-16 16:02:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-16 16:02:19 +0200 |
commit | e72785547696146f6172f0ef2824033e17df7b50 (patch) | |
tree | e78d6bafd7b3bcd9e786b5da8150cf02dcf2b4bb /tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | |
parent | ac5c64fccd6d491ee3b3a3f54460ed3464d714fc (diff) | |
parent | 5c23199d4e8ff21661dfa5aacc13149178e78cab (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index b4208949b0..7ad7880330 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -59,6 +59,7 @@ class tst_QWindow: public QObject private slots: void eventOrderOnShow(); + void resizeEventAfterResize(); void mapGlobal(); void positioning(); void isExposed(); @@ -168,6 +169,25 @@ void tst_QWindow::eventOrderOnShow() QVERIFY(window.eventIndex(QEvent::Resize) < window.eventIndex(QEvent::Expose)); } +void tst_QWindow::resizeEventAfterResize() +{ + // Some platforms enforce minimum widths for windows, which can cause extra resize + // events, so set the width to suitably large value to avoid those. + QRect geometry(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(20, 20), QSize(300, 40)); + + Window window; + window.setGeometry(geometry); + window.show(); + + QTRY_COMPARE(window.received(QEvent::Resize), 1); + + // QTBUG-32706 + // Make sure we get a resizeEvent after calling resize + window.resize(400, 100); + + QTRY_COMPARE(window.received(QEvent::Resize), 2); +} + void tst_QWindow::positioning() { if (!QGuiApplicationPrivate::platformIntegration()->hasCapability( |