summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_slider.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-17 23:08:00 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-18 22:11:24 +0200
commitd9aae9ff99d20b58487b0a48801864d13115363b (patch)
treee98089900164f7a1008e6fb59d1815dc9eab8d2c /tests/auto/controls/data/tst_slider.qml
parent49bd4b76d08ec11d08105ca71e8dda4f8d459b5c (diff)
parentc2356328f88b044c8956fe7860c4c04fca4f2c30 (diff)
downloadqtquickcontrols-d9aae9ff99d20b58487b0a48801864d13115363b.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/controls/Private/qquickrangemodel.cpp src/controls/Private/qquickrangemodel_p.h src/controls/Private/qquickrangemodel_p_p.h src/layouts/qquicklayout.cpp tests/auto/controls/data/tst_rangemodel.qml Change-Id: I9c8f6326c6edf9ebb18dd538f76830e1b439ba8e
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 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();
+ }
}
}