summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-12-15 13:38:05 +0100
committerLiang Qi <liang.qi@qt.io>2017-12-18 09:33:15 +0000
commit65976402344a2642d6d6dc5bfbf71b3b511f6d12 (patch)
tree1c13bd527a9c766da45ee116e38fc103e364853b
parent3e7b3aae9c736ec62a727f218a73f86886e2a367 (diff)
downloadqtquickcontrols-65976402344a2642d6d6dc5bfbf71b3b511f6d12.tar.gz
Tests_Slider::test_mouseWheel(): use fixed handle size
The default handle size is based off the height of text on the system that the test is run on. By making the size fixed, we remove the possibility for small differences in compare results. Task-number: QTBUG-65224 Change-Id: I14061a028360340c6b284fb450bf1252014dc9b2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--tests/auto/controls/data/tst_slider.qml18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml
index 9e2ba0f1..e95d26d9 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -136,8 +136,22 @@ Item {
slider.destroy()
}
+ Component {
+ id: fixedHandleSizeSlider
+
+ Slider {
+ style: SliderStyle {
+ handle: Rectangle {
+ color: "red"
+ implicitWidth: 15
+ implicitHeight: 15
+ }
+ }
+ }
+ }
+
function test_mouseWheel() {
- var slider = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {}', container, '');
+ var slider = createTemporaryObject(fixedHandleSizeSlider, container)
slider.forceActiveFocus()
slider.value = 0
slider.maximumValue = 300
@@ -182,8 +196,6 @@ Item {
slider.wheelEnabled = false
mouseWheel(slider, 5, 5, 4 * ratio, 0)
compare(slider.value, 0)
-
- slider.destroy()
}
function test_activeFocusOnPress(){