aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-07-27 15:42:17 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-07-28 10:35:15 +0000
commit0e01a25bc67ce1e4980d6f2fda5dab6cbb5f8b9d (patch)
tree9ffdf564c92bdfdb9179313b552067214fb472e5 /tests
parentd147f3ea83409edbeaa0ea58a5eb45c01e14dd56 (diff)
Add a sanity check for the position of handle.
The default style uses QQuickItem's transform property, so filling the handle with a Rectangle, for instance, will not show it in the correct position, even though it (the handle) is. Change-Id: I85af897d1bcc5e7f343cb9814da6d896088720b8 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/extras/data/tst_dial.qml6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/extras/data/tst_dial.qml b/tests/auto/extras/data/tst_dial.qml
index 0870f6b5..0d1a1124 100644
--- a/tests/auto/extras/data/tst_dial.qml
+++ b/tests/auto/extras/data/tst_dial.qml
@@ -78,12 +78,18 @@ TestCase {
function test_value() {
compare(dial.value, 0.0);
+ compare(Math.floor(dial.handle.mapToItem(parent, 0, 0).x), 28);
+ compare(Math.floor(dial.handle.mapToItem(parent, 0, 0).y), 90);
+
dial.value = 0.5;
compare(dial.value, 0.5);
+
dial.value = 1.0;
compare(dial.value, 1.0);
+
dial.value = -1.0;
compare(dial.value, 0.0);
+
dial.value = 2.0;
compare(dial.value, 1.0);
}