diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-01-11 13:16:24 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-12 12:08:19 +0100 |
commit | 16c2622fe7e8e43bdb6447399c816cd22c3c2f58 (patch) | |
tree | 7bbac965a630f6798064f9643ad95e6e4a5a37a6 /tests/auto/gui | |
parent | 738896d6b9bb9c521fcc7dd3d7418664411164a6 (diff) |
Made it possible to report screen changes through QWindowSystemInterface.
This makes it possible for platform plugin independent code (such as
generic plugins) to report changes to screen properties. An example
would be an accelerometer plugin that reports orientation changes
without knowing anything about the windowing system.
Change-Id: I984984b6d064327772c264bc942269422451da37
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/kernel/qscreen/tst_qscreen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp index a168203bdd..ab798a7351 100644 --- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp +++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp @@ -52,6 +52,7 @@ private slots: void angleBetween(); void transformBetween_data(); void transformBetween(); + void orientationChange(); }; void tst_QScreen::angleBetween_data() @@ -163,5 +164,16 @@ void tst_QScreen::transformBetween() QCOMPARE(QScreen::transformBetween(a, b, rect), expected); } +void tst_QScreen::orientationChange() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + + QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation); + QTRY_COMPARE(screen->currentOrientation(), Qt::LandscapeOrientation); + + QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::PortraitOrientation); + QTRY_COMPARE(screen->currentOrientation(), Qt::PortraitOrientation); +} + #include <tst_qscreen.moc> QTEST_MAIN(tst_QScreen); |