diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-21 08:33:50 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-21 08:33:50 +0200 |
commit | 4e26a18ede1775ae06bef7c272994e84510ebd9a (patch) | |
tree | 0543dca51dc0b4f7a42c755235db4b00d2f080b4 /tests/auto/controls/data/tst_slider.qml | |
parent | 271d1efc13d4534830e37fd12fa6202981da723c (diff) | |
parent | 3b093789b07c670e29d3275e26c4e7122db042ae (diff) | |
download | qtquickcontrols-4e26a18ede1775ae06bef7c272994e84510ebd9a.tar.gz |
Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I20f0f7a50b55907f4a6e574bdfe92bc9538879d6
Diffstat (limited to 'tests/auto/controls/data/tst_slider.qml')
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index 48612215..1d7e92d2 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -48,11 +48,12 @@ ** ****************************************************************************/ -import QtQuick 2.2 +import QtQuick 2.6 import QtTest 1.0 import QtQuickControlsTests 1.0 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.4 import QtQuick.Controls.Private 1.0 +import QtQuick.Controls.Styles 1.4 Item { id: container @@ -74,6 +75,12 @@ Item { id: util } + Component { + id: sliderComponent + + Slider {} + } + function test_vertical() { var slider = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {}', testCase, ''); verify(slider.height < slider.width) @@ -371,5 +378,34 @@ Item { control.destroy() component.destroy() } + + Component { + id: namedHandleStyle + + SliderStyle { + handle: Rectangle { + objectName: "sliderHandle" + implicitWidth: 20 + implicitHeight: 20 + color: "salmon" + } + } + } + + function test_minimumValueLargerThanValue() { + var control = sliderComponent.createObject(container, { "style": namedHandleStyle, "minimumValue": 0, "maximumValue": 2, value: "minimumValue" }); + verify(control); + + var handle = findChild(control, "sliderHandle"); + verify(handle); + + // The handle should stay within the bounds of the slider when + // minimumValue is set to a value larger than "value". + control.minimumValue = 1; + compare(control.value, control.minimumValue); + compare(handle.mapToItem(null, 0, 0).x, 0) + + control.destroy(); + } } } |