diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2021-07-27 09:00:56 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-13 11:51:03 +0000 |
commit | 6a93a602e3dbad0afbd2b5bd760a73fded0a099d (patch) | |
tree | 59adbf06c0eb616fbce3e310f879269e26ff5c9b /tests | |
parent | d6ab980f1c3957182f6f9143b90b46260f71602d (diff) |
RangeSlider: fix both handles being hovered
When both handles overlap, only the handle with
the higher Z value should be hovered.
Fixes: QTBUG-94558
Done-with: Mitch Curtis <mitch.curtis@qt.io>
Change-Id: I6565e199ea77f3fae7a0d2dc84b36fa244bc7260
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 603c91f330b40ceab20272db16f3dbffa4edd0ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
6 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/controls/basic/BLACKLIST b/tests/auto/quickcontrols2/controls/basic/BLACKLIST index 476340700a..60964a2d57 100644 --- a/tests/auto/quickcontrols2/controls/basic/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/basic/BLACKLIST @@ -3,3 +3,7 @@ # QTBUG-70597 [Tumbler::test_itemsCorrectlyPositioned] * + +# QTBUG-95750 +[RangeSlider::test_overlappingHandles] +b2qt diff --git a/tests/auto/quickcontrols2/controls/data/tst_rangeslider.qml b/tests/auto/quickcontrols2/controls/data/tst_rangeslider.qml index 5e4d715034..6cb510578e 100644 --- a/tests/auto/quickcontrols2/controls/data/tst_rangeslider.qml +++ b/tests/auto/quickcontrols2/controls/data/tst_rangeslider.qml @@ -622,6 +622,12 @@ TestCase { control.first.value = 0 control.second.value = 0 + // When both handles overlap, only the handle with the higher Z value + // should be hovered. + mouseMove(control, control.second.handle.x, control.second.handle.y) + compare(control.second.hovered, true) + compare(control.first.hovered, false) + // Both are at the same position, so it doesn't matter whose coordinates we use. mousePress(control, control.first.handle.x, control.first.handle.y, Qt.LeftButton) verify(control.second.pressed) @@ -636,6 +642,9 @@ TestCase { compare(control.second.handle.z, 1) compare(control.first.handle.z, 0) + // The first handle should not be hovered. + compare(control.first.hovered, false) + // Move the first handle on top of the second. mousePress(control, control.first.handle.x, control.first.handle.y, Qt.LeftButton) verify(control.first.pressed) diff --git a/tests/auto/quickcontrols2/controls/fusion/BLACKLIST b/tests/auto/quickcontrols2/controls/fusion/BLACKLIST index 476340700a..60964a2d57 100644 --- a/tests/auto/quickcontrols2/controls/fusion/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/fusion/BLACKLIST @@ -3,3 +3,7 @@ # QTBUG-70597 [Tumbler::test_itemsCorrectlyPositioned] * + +# QTBUG-95750 +[RangeSlider::test_overlappingHandles] +b2qt diff --git a/tests/auto/quickcontrols2/controls/imagine/BLACKLIST b/tests/auto/quickcontrols2/controls/imagine/BLACKLIST index 476340700a..60964a2d57 100644 --- a/tests/auto/quickcontrols2/controls/imagine/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/imagine/BLACKLIST @@ -3,3 +3,7 @@ # QTBUG-70597 [Tumbler::test_itemsCorrectlyPositioned] * + +# QTBUG-95750 +[RangeSlider::test_overlappingHandles] +b2qt diff --git a/tests/auto/quickcontrols2/controls/material/BLACKLIST b/tests/auto/quickcontrols2/controls/material/BLACKLIST index 476340700a..60964a2d57 100644 --- a/tests/auto/quickcontrols2/controls/material/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/material/BLACKLIST @@ -3,3 +3,7 @@ # QTBUG-70597 [Tumbler::test_itemsCorrectlyPositioned] * + +# QTBUG-95750 +[RangeSlider::test_overlappingHandles] +b2qt diff --git a/tests/auto/quickcontrols2/controls/universal/BLACKLIST b/tests/auto/quickcontrols2/controls/universal/BLACKLIST index 476340700a..60964a2d57 100644 --- a/tests/auto/quickcontrols2/controls/universal/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/universal/BLACKLIST @@ -3,3 +3,7 @@ # QTBUG-70597 [Tumbler::test_itemsCorrectlyPositioned] * + +# QTBUG-95750 +[RangeSlider::test_overlappingHandles] +b2qt |