diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-05 03:03:27 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-05 03:03:27 +0200 |
commit | a4ecc76df944cce5152cdfc8fd27436390a4fa62 (patch) | |
tree | c840006f08a790bf4c9ce362e98d826009f520fc /tests/auto/controls/data | |
parent | 472750be915b7cab88c5daaca1246f58c6bd0f72 (diff) | |
parent | a392194a575653dff3cd21227e6a1a2902b8399f (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I25813bc151347f69d4dbd9f61729300626be763f
Diffstat (limited to 'tests/auto/controls/data')
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 9 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tumbler.qml | 27 |
2 files changed, 33 insertions, 3 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index 18911895..70579c70 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -205,6 +205,15 @@ TestCase { else control.visible = true compare(control.visible, true) + // wait a bit to make sure that it's still visible + wait(50) + compare(control.visible, true) + // re-arm for another 200 ms + control.timeout = 200 + compare(control.visible, true) + // ensure that it's still visible after 150 ms (where old timeout < 150 < new timeout) + wait(150) + compare(control.visible, true) tryCompare(control, "visible", false) } diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index c9cc10d7..5b3ef6e3 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -54,8 +54,8 @@ import QtQuick.Controls 2.12 TestCase { id: testCase - width: 200 - height: 200 + width: 300 + height: 300 visible: true when: windowShown name: "Tumbler" @@ -513,6 +513,7 @@ TestCase { Text { text: parent.displacement.toFixed(2) anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter } property real displacement: Tumbler.displacement @@ -1236,4 +1237,24 @@ TestCase { // 5 - 2 = 3 compare(tumbler.currentIndex, 3); } + + function test_displacementAfterResizing() { + createTumbler({ + width: 200, + wrap: false, + delegate: displacementDelegate, + model: 30, + visibleItemCount: 7, + currentIndex: 15 + }) + + var delegate = findChild(tumblerView, "delegate15") + verify(delegate) + + tryCompare(delegate, "displacement", 0) + + // Resizing the Tumbler shouldn't affect the displacement. + tumbler.height *= 1.4 + tryCompare(delegate, "displacement", 0) + } } |