diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-01-25 13:41:43 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-26 08:32:28 +0100 |
commit | 71db6d654ec4a3166325933ca3a9f5859013c110 (patch) | |
tree | cc23527fe27b7324a8ee0ffcb434e990d40de935 /tests | |
parent | 0bca94cf380a4fc55cf3a46de979d0618f3fa455 (diff) |
Made QWindow::currentOrientation() a property.
To match the previous QWindow::orientation() property which can be
useful to access from QML. Also, removed the automatic translation of
Qt::PrimaryOrientation to QScreen::primaryOrientation() on the QWindow
level, as it leads to a lot of complexity regarding the
QWindow::contentOrientationChanged() signal, and makes it hard to
distinguish between the case where the window's orientation follows
that of the screen, and the case where the orientation just happens to
be set to that of the screen.
Change-Id: I6950d1337b7f929815eff1328181855090d8066b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index d0d2ce1e1d..91f9e4ef49 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -492,11 +492,15 @@ void tst_QWindow::orientation() QCOMPARE(window.contentOrientation(), Qt::PortraitOrientation); window.reportContentOrientationChange(Qt::PrimaryOrientation); - QCOMPARE(window.contentOrientation(), window.screen()->primaryOrientation()); + QCOMPARE(window.contentOrientation(), Qt::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()); + QVERIFY(!window.requestWindowOrientation(Qt::PrimaryOrientation) || window.windowOrientation() == Qt::PrimaryOrientation); + + QSignalSpy spy(&window, SIGNAL(contentOrientationChanged(Qt::ScreenOrientation))); + window.reportContentOrientationChange(Qt::LandscapeOrientation); + QCOMPARE(spy.count(), 1); } #include <tst_qwindow.moc> |