aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickscreen
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-10-17 14:24:07 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-10-23 09:03:16 +0200
commite2764c722571025835e41632637d1421ba44fb02 (patch)
treefcbe4624419e0332ba0330aa6402123c39f03523 /tests/auto/quick/qquickscreen
parenta1b43cb272ff05bd8c681d4d6320dcfee7339d84 (diff)
Screen attached property: expose devicePixelRatio property
Change-Id: I08b22766b3e389b7d27ca4c56729f550b0647a08 Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickscreen')
-rw-r--r--tests/auto/quick/qquickscreen/data/screen.qml1
-rw-r--r--tests/auto/quick/qquickscreen/tst_qquickscreen.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickscreen/data/screen.qml b/tests/auto/quick/qquickscreen/data/screen.qml
index dc3803f4e3..c246b3cd83 100644
--- a/tests/auto/quick/qquickscreen/data/screen.qml
+++ b/tests/auto/quick/qquickscreen/data/screen.qml
@@ -9,6 +9,7 @@ Item {
property int curOrientation: Window.Screen.orientation
property int priOrientation: Window.Screen.primaryOrientation
property int updateMask: Window.Screen.orientationUpdateMask
+ property real devicePixelRatio: Window.Screen.devicePixelRatio
Window.Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation
}
diff --git a/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp b/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
index be543e8022..70ecff51eb 100644
--- a/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
+++ b/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
@@ -63,6 +63,8 @@ void tst_qquickscreen::basicProperties()
QCOMPARE(int(screen->orientation()), root->property("curOrientation").toInt());
QCOMPARE(int(screen->primaryOrientation()), root->property("priOrientation").toInt());
QCOMPARE(int(screen->orientationUpdateMask()), root->property("updateMask").toInt());
+ QCOMPARE(screen->devicePixelRatio(), root->property("devicePixelRatio").toReal());
+ QVERIFY(screen->devicePixelRatio() >= 1.0);
}
QTEST_MAIN(tst_qquickscreen)