diff options
Diffstat (limited to 'tests/auto/controls/data/tst_pageindicator.qml')
-rw-r--r-- | tests/auto/controls/data/tst_pageindicator.qml | 36 |
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 70813cb8..191228f2 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) } } } |