Update example in a doc.
authorSukhyun Kim <sukhyun.kim@nokia.com>
Wed, 13 Jun 2012 04:47:28 +0000 (13:47 +0900)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 04:04:01 +0000 (06:04 +0200)
There are "TypeError" errors.
When using ListView.view in a delegate, the id of child of delegate has to
attach in front of ListView.view to access the model and its properties in this case.

Change-Id: I4610f1fc8b0d085f7cba137e76e0578be7b51e23
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>

src/quick/doc/snippets/qml/models/views-models-delegates.qml

index e9f8725..671d6c7 100644 (file)
@@ -63,9 +63,10 @@ Rectangle {
     Component {
         id: fruitDelegate
         Row {
-                Text { text: " Fruit: " + name; color: ListView.view.fruit_color }
+                id: fruit
+                Text { text: " Fruit: " + name; color: fruit.ListView.view.fruit_color }
                 Text { text: " Cost: $" + cost }
-                Text { text: " Language: " + ListView.view.model.language }
+                Text { text: " Language: " + fruit.ListView.view.model.language }
         }
     }