diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-22 22:18:32 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-22 22:20:46 +0200 |
commit | d1990ff285a8a265fc41d193179ce8fb6746f7b3 (patch) | |
tree | d4e78a873de079a04d2b4d64d81e4a4af84b3ae7 /tests/auto/controls/data/tst_pageindicator.qml | |
parent | 309170a7f97759aa3f2e25a6c5202a6438a8bf4f (diff) | |
parent | 53c4bc2d1004fe963759b4009508bbc3e3fbca3e (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I9188f94e40e2ecb4da1963ce2fcf915ab7a4b4fb
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 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) } } } |