summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-19 21:12:09 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-09-19 21:12:09 +0200
commitf9a84d50341d1f57452c412d2bb1280eace61f76 (patch)
treee8f1752bab55569331a06fa82ea20686ab674a28
parent1f8ee02fbc06f822ee131fdd395c8e8cd244601d (diff)
parent09a74592234c84b3e428b452d844eaa1f6451040 (diff)
Merge branch 'stable' into dev
Conflicts: tests/auto/controls/data/tst_splitview.qml Change-Id: I07a169238e747d953b555911790fa782888b85e8
-rw-r--r--src/controls/SplitView.qml23
-rw-r--r--tests/auto/controls/data/tst_splitview.qml33
2 files changed, 45 insertions, 11 deletions
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index 795a1e18f..d0df42837 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -295,17 +295,18 @@ Item {
// calculate their acummulated width.
var w = 0
for (var i=firstIndex; i<lastIndex; ++i) {
+
var item = __items[i]
if (item.visible || i == d.fillIndex) {
if (i !== d.fillIndex)
w += item[d.size];
else if (includeFillItemMinimum && item.Layout[minimum] !== undefined)
w += item.Layout[minimum]
-
- var handle = __handles[i]
- if (handle && handle.visible)
- w += handle[d.size]
}
+
+ var handle = __handles[i]
+ if (handle && handle.visible)
+ w += handle[d.size]
}
return w
}
@@ -353,14 +354,14 @@ Item {
item[d.otherOffset] = 0
item[d.otherSize] = clampedMinMax(root[otherSize], item.Layout[otherMinimum], item.Layout[otherMaximum])
lastVisibleItem = item
+ }
- handle = __handles[i]
- if (handle && handle.visible) {
- handle[d.offset] = lastVisibleItem[d.offset] + Math.max(0, lastVisibleItem[d.size])
- handle[d.otherOffset] = 0
- handle[d.otherSize] = root[d.otherSize]
- lastVisibleHandle = handle
- }
+ handle = __handles[i]
+ if (handle && handle.visible) {
+ handle[d.offset] = lastVisibleItem[d.offset] + Math.max(0, lastVisibleItem[d.size])
+ handle[d.otherOffset] = 0
+ handle[d.otherSize] = root[d.otherSize]
+ lastVisibleHandle = handle
}
}
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml
index 80cd9fb97..6ba340272 100644
--- a/tests/auto/controls/data/tst_splitview.qml
+++ b/tests/auto/controls/data/tst_splitview.qml
@@ -41,6 +41,7 @@
import QtQuick 2.1
import QtTest 1.0
import QtQuick.Controls 1.1
+import QtQuick.Layouts 1.0
import QtQuickControlsTests 1.0
TestCase {
@@ -76,6 +77,29 @@ TestCase {
}
}
+ Component {
+ id: splitView_hide_item_after_fillWidth
+ SplitView {
+ anchors.fill: parent
+ property alias item3: item3
+ handleDelegate: Rectangle { width: handleWidth; height: handleHeight; color: "black" }
+ Rectangle {
+ color: "yellow"
+ Layout.fillWidth: true
+ }
+ Rectangle {
+ color: "green"
+ Layout.minimumWidth: 100
+ visible: false
+ }
+ Rectangle {
+ id: item3
+ color: "blue"
+ Layout.minimumWidth: 100
+ }
+ }
+ }
+
function test_01_splitView() {
var view = splitView.createObject(testCase);
verify (view !== null, "splitview created is null")
@@ -180,4 +204,13 @@ TestCase {
compare (view.item2.height, 500)
view.destroy()
}
+
+ function test_hide_item_after_fillWidth() {
+ // QTBUG-33448
+ var view = splitView_hide_item_after_fillWidth.createObject(testCase);
+ verify (view !== null, "splitview created is null")
+ waitForRendering(view)
+ compare (view.item3.x, view.width - view.item3.width)
+ view.destroy()
+ }
}