aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_pageindicator.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-10-22 22:18:32 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-10-22 22:20:46 +0200
commitd1990ff285a8a265fc41d193179ce8fb6746f7b3 (patch)
treed4e78a873de079a04d2b4d64d81e4a4af84b3ae7 /tests/auto/controls/data/tst_pageindicator.qml
parent309170a7f97759aa3f2e25a6c5202a6438a8bf4f (diff)
parent53c4bc2d1004fe963759b4009508bbc3e3fbca3e (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Diffstat (limited to 'tests/auto/controls/data/tst_pageindicator.qml')
-rw-r--r--tests/auto/controls/data/tst_pageindicator.qml36
1 files changed, 24 insertions, 12 deletions
diff --git a/tests/auto/controls/data/tst_pageindicator.qml b/tests/auto/controls/data/tst_pageindicator.qml
index f3151882..dc411e45 100644
--- a/tests/auto/controls/data/tst_pageindicator.qml
+++ b/tests/auto/controls/data/tst_pageindicator.qml
@@ -122,18 +122,30 @@ TestCase {
// test also clicking outside delegates => the nearest should be selected
for (var i = 0; i < control.count; ++i) {
var child = control.contentItem.children[i]
- for (var x = -2; x <= child.width + 2; ++x) {
- for (var y = -2; y <= child.height + 2; ++y) {
- control.currentIndex = -1
- compare(control.currentIndex, -1)
-
- var pos = control.mapFromItem(child, x, y)
- if (data.touch)
- touch.press(0, control, pos.x, pos.y).commit().release(0, control, pos.x, pos.y).commit()
- else
- mouseClick(control, pos.x, pos.y, Qt.LeftButton)
- compare(control.currentIndex, i)
- }
+
+ var points = [
+ Qt.point(child.width / 2, -2), // top
+ Qt.point(-2, child.height / 2), // left
+ Qt.point(child.width + 2, child.height / 2), // right
+ Qt.point(child.width / 2, child.height + 2), // bottom
+
+ Qt.point(-2, -2), // top-left
+ Qt.point(child.width + 2, -2), // top-right
+ Qt.point(-2, child.height + 2), // bottom-left
+ Qt.point(child.width + 2, child.height + 2), // bottom-right
+ ]
+
+ for (var j = 0; j < points.length; ++j) {
+ control.currentIndex = -1
+ compare(control.currentIndex, -1)
+
+ var point = points[j]
+ var pos = control.mapFromItem(child, x, y)
+ if (data.touch)
+ touch.press(0, control, pos.x, pos.y).commit().release(0, control, pos.x, pos.y).commit()
+ else
+ mouseClick(control, pos.x, pos.y, Qt.LeftButton)
+ compare(control.currentIndex, i)
}
}
}