aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-06-12 11:54:40 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-12 15:40:13 +0200
commit14e15458a53ea5de16d829dd0dce0d9d0c4f1611 (patch)
treebbd0f7b1df539ad06f252196a2fd1bdbd7f5a1e6 /tests/auto/quick/qquicklistview/data
parenteacbc7805e937e64b7e117705919b214aed4f736 (diff)
Fix view delegate parent binding regression.
762b4d90110465aeceb96f44cd06dcda229dfe89 introduced a regression by setting the item parent after completion. This was to avoid rendering an incubated object before completion. However this breaks bindings. Restore setting the item parent before completion, and ensure items are not rendered until completed. Change-Id: Ifc9d0c34ee62e687889c32ffab7c091b4c8cc470 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/parentBinding.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/parentBinding.qml b/tests/auto/quick/qquicklistview/data/parentBinding.qml
new file mode 100644
index 0000000000..b56372888d
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/parentBinding.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+
+ListView {
+ width: 320; height: 480
+ model: ListModel {}
+ cacheBuffer: 300
+ delegate: Rectangle {
+ objectName: "wrapper"
+ width: parent.width
+ height: parent.parent.height/12
+ color: index % 2 ? "red" : "blue"
+ }
+ Component.onCompleted: {
+ for (var i = 0; i < 100; ++i)
+ model.append({"foo":"bar"+i})
+ }
+}