diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-06-02 07:19:22 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-06-02 07:20:28 (GMT) |
commit | 74232ac426d9911417e880334292925f47f0df1e (patch) | |
tree | dc12ff691f7045a8a2ed620db128cb4144c9b995 /tests/auto/declarative/qdeclarativeviewer | |
parent | 04eb4d19a32c92453c6a74037e4ddf065e5e4f49 (diff) | |
download | Qt-74232ac426d9911417e880334292925f47f0df1e.zip Qt-74232ac426d9911417e880334292925f47f0df1e.tar.gz Qt-74232ac426d9911417e880334292925f47f0df1e.tar.bz2 |
QML viewer now supports TopUp, TopDown, RightUp and LeftUp orientations
instead of Portrait/Landscape. The new orientations are named the same
as the orientations in the QtMobility sensors module.
Task-number: QTBUG-11106
Reviewed-by: akennedy
Diffstat (limited to 'tests/auto/declarative/qdeclarativeviewer')
-rw-r--r-- | tests/auto/declarative/qdeclarativeviewer/data/orientation.qml | 17 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp | 4 |
2 files changed, 15 insertions, 6 deletions
diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml index 687fac6..be911a3 100644 --- a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml +++ b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml @@ -1,10 +1,19 @@ import Qt 4.7 Rectangle { color: "black" - width: (runtime.orientation == Orientation.Landscape) ? 300 : 200 - height: (runtime.orientation == Orientation.Landscape) ? 200 : 300 + width: (runtime.orientation == Orientation.RightUp || runtime.orientation == Orientation.LeftUp) ? 300 : 200 + height: (runtime.orientation == Orientation.RightUp || runtime.orientation == Orientation.LeftUp) ? 200 : 300 Text { - text: runtime.orientation == Orientation.Landscape ? "Landscape" : "Portrait" + text: { + if (runtime.orientation == Orientation.TopUp) + return "TopUp" + if (runtime.orientation == Orientation.TopDown) + return "TopDown" + if (runtime.orientation == Orientation.LeftUp) + return "LeftUp" + if (runtime.orientation == Orientation.RightUp) + return "RightUp" + } color: "white" } -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp index 9429dc9..f296d9e 100644 --- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp +++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp @@ -82,7 +82,7 @@ void tst_QDeclarativeViewer::orientation() QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height())); QCOMPARE(viewer->size(), viewer->sizeHint()); - viewer->toggleOrientation(); + viewer->rotateOrientation(); qApp->processEvents(); QCOMPARE(rootItem->width(), 300.0); @@ -92,7 +92,7 @@ void tst_QDeclarativeViewer::orientation() QCOMPARE(viewer->size(), QSize(300, 200+viewer->menuBar()->height())); QCOMPARE(viewer->size(), viewer->sizeHint()); - viewer->toggleOrientation(); + viewer->rotateOrientation(); qApp->processEvents(); QCOMPARE(rootItem->width(), 200.0); |