aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-05-22 13:08:38 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-05-22 17:31:36 +0000
commitad2d389c48c1b7ca5472373b869c80ce7ba4f6e8 (patch)
tree9550745b853d6d583dbca6ab752d13dc6fd22a0d /tests/auto/controls
parentb3e053e2d0285064e5c3b2467dac7ffeecd88266 (diff)
Make tst_pageindicator::test_interactive() more reliable
PageIndicator uses Row internally, and changing its spacing triggers an asynchronous relayout. Instead of waiting for the Row to relayout, just pass the padding and spacing at construction time to ensure that the Row has suitable layout for testing mouse clicks between the row items. Change-Id: I9c25c6b57042abb0363bdfe73ebac047cff0fcc7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_pageindicator.qml5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/auto/controls/data/tst_pageindicator.qml b/tests/auto/controls/data/tst_pageindicator.qml
index 6d2842c4..86c0bd8b 100644
--- a/tests/auto/controls/data/tst_pageindicator.qml
+++ b/tests/auto/controls/data/tst_pageindicator.qml
@@ -84,7 +84,7 @@ TestCase {
}
function test_interactive() {
- var control = createTemporaryObject(pageIndicator, testCase, {count: 5})
+ var control = createTemporaryObject(pageIndicator, testCase, {count: 5, spacing: 10, padding: 10})
verify(control)
verify(!control.interactive)
@@ -100,9 +100,6 @@ TestCase {
compare(control.currentIndex, 2)
// test also clicking outside delegates => the nearest should be selected
- control.padding = 10
- control.spacing = 10
-
for (var i = 0; i < control.count; ++i) {
var child = control.contentItem.children[i]
for (var x = -2; x <= child.width + 2; ++x) {