diff options
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index ac8c8f9b20..d0d2ce1e1d 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -57,6 +57,7 @@ private slots: void touchToMouseTranslation(); void mouseToTouchTranslation(); void mouseToTouchLoop(); + void orientation(); void initTestCase() { touchDevice = new QTouchDevice; @@ -481,5 +482,22 @@ void tst_QWindow::mouseToTouchLoop() qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false); } +void tst_QWindow::orientation() +{ + QWindow window; + window.setGeometry(80, 80, 40, 40); + window.create(); + + window.reportContentOrientationChange(Qt::PortraitOrientation); + QCOMPARE(window.contentOrientation(), Qt::PortraitOrientation); + + window.reportContentOrientationChange(Qt::PrimaryOrientation); + QCOMPARE(window.contentOrientation(), window.screen()->primaryOrientation()); + + QVERIFY(!window.requestWindowOrientation(Qt::LandscapeOrientation) || window.windowOrientation() == Qt::LandscapeOrientation); + QVERIFY(!window.requestWindowOrientation(Qt::PortraitOrientation) || window.windowOrientation() == Qt::PortraitOrientation); + QVERIFY(!window.requestWindowOrientation(Qt::PrimaryOrientation) || window.windowOrientation() == window.screen()->primaryOrientation()); +} + #include <tst_qwindow.moc> QTEST_MAIN(tst_QWindow); |