diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-02-20 19:39:11 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-21 08:23:37 +0100 |
commit | cf53bf9ae6716613c120cc4a0202c69bd59eba1e (patch) | |
tree | c8d24a705913bd0c79ca51f807d0b49845cb975f /tests/auto | |
parent | 8c8404f8153508106f65efb43110ba85c05e73bc (diff) |
Make sure exposeEvents trigger a render pass
We needs this on non-compositing window managers to trigger
repaints on partial updates.
Change-Id: Ied5f3e854173c5e00ad7e1222aeb66eb9c96158c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 858653a613..b2e07e4c13 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -320,6 +320,8 @@ private slots: void showHideAnimate(); + void testExpose(); + #ifndef QT_NO_CURSOR void cursor(); #endif @@ -1375,6 +1377,28 @@ void tst_qquickwindow::showHideAnimate() QTRY_VERIFY(created->opacity() < 0.5); } +void tst_qquickwindow::testExpose() +{ + QQuickWindow window; + window.setGeometry(100, 100, 300, 200); + + window.show(); + QTRY_VERIFY(window.isExposed()); + + QSignalSpy swapSpy(&window, SIGNAL(frameSwapped())); + + // exhaust pending exposes, as some platforms send us plenty + // while showing the first time + QTest::qWait(1000); + while (swapSpy.size() != 0) { + swapSpy.clear(); + QTest::qWait(100); + } + + QWindowSystemInterface::handleExposeEvent(&window, QRegion(10, 10, 20, 20)); + QTRY_COMPARE(swapSpy.size(), 1); +} + QTEST_MAIN(tst_qquickwindow) #include "tst_qquickwindow.moc" |