summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_splitview.qml
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-09-18 10:22:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 09:17:24 +0200
commit09a74592234c84b3e428b452d844eaa1f6451040 (patch)
treef1e391eb3a6f897c8d3506db8914ba4be7a638e8 /tests/auto/controls/data/tst_splitview.qml
parent04e000d2b1719696581bb4ae6ec21e39236ef38c (diff)
downloadqtquickcontrols-09a74592234c84b3e428b452d844eaa1f6451040.tar.gz
SplitView: fix hidden item after fillWidth item bugold/5.1
Some of the calculations in SplitView assumed that if item with index i was hidden, then so was handle at index i as well. This is not correct. The reason is that a the handle at i belongs to either item i or item i+1, depending on where the fillWidth item is. And this caused a bug when hiding the item to the right of the fillWidth item. Conflicts: tests/auto/controls/data/tst_splitview.qml Change-Id: I59967813f264a856181c57e32c4820d09d7eb363 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_splitview.qml')
-rw-r--r--tests/auto/controls/data/tst_splitview.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml
index 05101ff9..e42f0cee 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.0
+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()
+ }
}