summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/controls/Slider.qml6
-rw-r--r--src/controls/SplitView.qml6
-rw-r--r--src/controls/Styles/Base/CheckBoxStyle.qml2
-rw-r--r--src/controls/TableViewColumn.qml2
-rw-r--r--tests/auto/controls/data/tst_scrollview.qml2
-rw-r--r--tests/auto/controls/data/tst_slider.qml40
6 files changed, 50 insertions, 8 deletions
diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml
index 20d11025..981a619b 100644
--- a/src/controls/Slider.qml
+++ b/src/controls/Slider.qml
@@ -173,9 +173,11 @@ Control {
/*! \internal
The extra arguments positionAtMinimum and positionAtMaximum are there to force
- re-evaluation of the handle position when the constraints change (QTBUG-41255).
+ re-evaluation of the handle position when the constraints change (QTBUG-41255),
+ and the same for range.minimumValue (QTBUG-51765).
*/
- property real __handlePos: range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y, range.positionAtMinimum, range.positionAtMaximum)
+ property real __handlePos: range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y,
+ range.positionAtMinimum, range.positionAtMaximum, range.minimumValue)
activeFocusOnTab: true
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index 868108aa..02b788bc 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -58,9 +58,13 @@ import QtQuick.Window 2.1
item will get all leftover space when other items have been laid out.
By default, the last visible child of the SplitView will have this set, but
it can be changed by explicitly setting fillWidth to \c true on another item.
+
As the fillWidth item will automatically be resized to fit the extra space, explicit assignments
- to width and height will be ignored (but \l{Layout::minimumWidth}{Layout.minimumWidth} and
+ to its width and height properties will be ignored (but \l{Layout::minimumWidth}{Layout.minimumWidth} and
\l{Layout::maximumWidth}{Layout.maximumWidth} will still be respected).
+ The initial sizes of other items should be set via their width and height properties.
+ Any binding assignment to an item's width or height will be broken as soon as the user
+ drags that item's splitter handle.
A handle can belong to the item either on the left or top side, or on the right or bottom side:
\list
diff --git a/src/controls/Styles/Base/CheckBoxStyle.qml b/src/controls/Styles/Base/CheckBoxStyle.qml
index a4028fef..68b1aa76 100644
--- a/src/controls/Styles/Base/CheckBoxStyle.qml
+++ b/src/controls/Styles/Base/CheckBoxStyle.qml
@@ -111,7 +111,7 @@ Style {
/*! This defines the indicator button. */
property Component indicator: Item {
implicitWidth: Math.round(TextSingleton.implicitHeight)
- height: width
+ implicitHeight: implicitWidth
Rectangle {
anchors.fill: parent
anchors.bottomMargin: -1
diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml
index 3f5a8468..6e253614 100644
--- a/src/controls/TableViewColumn.qml
+++ b/src/controls/TableViewColumn.qml
@@ -74,7 +74,7 @@ QtObject {
/*! The model \c role of the column. */
property string role
- /*! The current width of the column
+ /*! The current width of the column.
The default value depends on platform. If only one
column is defined, the width expands to the viewport.
*/
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml
index cb96c3db..cc737664 100644
--- a/tests/auto/controls/data/tst_scrollview.qml
+++ b/tests/auto/controls/data/tst_scrollview.qml
@@ -133,7 +133,7 @@ TestCase {
var scrollView = dragFetchAppendComponent.createObject(container)
verify(scrollView !== null, "view created is null")
waitForRendering(scrollView)
- verify(scrollView.flickableItem.contentHeight === 60 * 20)
+ tryCompare(scrollView.flickableItem, "contentHeight", 60 * 20)
// After scrolling to the end, view should ask the model to fetch more
// data, content height should increase and scrollbar handle should move
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();
+ }
}
}