aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols/controls/data/tst_pageindicator.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols/controls/data/tst_pageindicator.qml')
-rw-r--r--tests/auto/quickcontrols/controls/data/tst_pageindicator.qml41
1 files changed, 24 insertions, 17 deletions
diff --git a/tests/auto/quickcontrols/controls/data/tst_pageindicator.qml b/tests/auto/quickcontrols/controls/data/tst_pageindicator.qml
index 837972cdc2..391eb91248 100644
--- a/tests/auto/quickcontrols/controls/data/tst_pageindicator.qml
+++ b/tests/auto/quickcontrols/controls/data/tst_pageindicator.qml
@@ -1,5 +1,5 @@
// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtTest
@@ -15,23 +15,30 @@ TestCase {
Component {
id: pageIndicator
- PageIndicator { }
+ PageIndicator {
+ objectName: "pageIndicator"
+ contentItem.objectName: "pageIndicatorContentItem"
+ }
}
Component {
id: mouseArea
- MouseArea { }
+ MouseArea {
+ objectName: "mouseArea"
+ }
}
- function test_defaults() {
+ function init() {
failOnWarning(/.?/)
+ }
+ function test_defaults() {
let control = createTemporaryObject(pageIndicator, testCase)
verify(control)
}
function test_count() {
- var control = createTemporaryObject(pageIndicator, testCase)
+ let control = createTemporaryObject(pageIndicator, testCase)
verify(control)
compare(control.count, 0)
@@ -40,7 +47,7 @@ TestCase {
}
function test_currentIndex() {
- var control = createTemporaryObject(pageIndicator, testCase)
+ let control = createTemporaryObject(pageIndicator, testCase)
verify(control)
compare(control.currentIndex, 0)
@@ -56,13 +63,13 @@ TestCase {
}
function test_interactive(data) {
- var control = createTemporaryObject(pageIndicator, testCase, {count: 5, spacing: 10, topPadding: 10, leftPadding: 10, rightPadding: 10, bottomPadding: 10})
+ let control = createTemporaryObject(pageIndicator, testCase, {count: 5, spacing: 10, topPadding: 10, leftPadding: 10, rightPadding: 10, bottomPadding: 10})
verify(control)
verify(!control.interactive)
compare(control.currentIndex, 0)
- var touch = touchEvent(control)
+ let touch = touchEvent(control)
if (data.touch)
touch.press(0, control).commit().release(0, control).commit()
@@ -80,10 +87,10 @@ TestCase {
compare(control.currentIndex, 2)
// 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 (let i = 0; i < control.count; ++i) {
+ let child = control.contentItem.children[i]
- var points = [
+ let points = [
Qt.point(child.width / 2, -2), // top
Qt.point(-2, child.height / 2), // left
Qt.point(child.width + 2, child.height / 2), // right
@@ -95,12 +102,12 @@ TestCase {
Qt.point(child.width + 2, child.height + 2), // bottom-right
]
- for (var j = 0; j < points.length; ++j) {
+ for (let j = 0; j < points.length; ++j) {
control.currentIndex = -1
compare(control.currentIndex, -1)
- var point = points[j]
- var pos = control.mapFromItem(child, x, y)
+ let point = points[j]
+ let 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
@@ -119,10 +126,10 @@ TestCase {
// QTBUG-61785
function test_mouseArea(data) {
- var ma = createTemporaryObject(mouseArea, testCase, {width: testCase.width, height: testCase.height})
+ let ma = createTemporaryObject(mouseArea, testCase, {width: testCase.width, height: testCase.height})
verify(ma)
- var control = pageIndicator.createObject(ma, {count: 5, interactive: data.interactive, width: testCase.width, height: testCase.height})
+ let control = pageIndicator.createObject(ma, {count: 5, interactive: data.interactive, width: testCase.width, height: testCase.height})
verify(control)
compare(control.interactive, data.interactive)
@@ -133,7 +140,7 @@ TestCase {
mouseRelease(control)
verify(!ma.pressed)
- var touch = touchEvent(control)
+ let touch = touchEvent(control)
touch.press(0, control).commit()
compare(ma.pressed, !data.interactive)