summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_slider.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_slider.qml')
-rw-r--r--tests/auto/controls/data/tst_slider.qml40
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 83ba299e..9b79bc29 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -38,11 +38,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
@@ -64,6 +65,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)
@@ -361,5 +368,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();
+ }
}
}