<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
I think I have spotted a documentation bug in the SDK.<br>
The example given in in Sailfish Silica Reference Documentation for
the SilicaGridView uses the wrong data type in ListModel.<br>
<br>
import QtQuick 2.0<br>
import Sailfish.Silica 1.0<br>
<br>
SilicaGridView {<br>
width: 480; height: 800<br>
model: ListModel {<br>
ListItem { fruit: "jackfruit" }<br>
ListItem { fruit: "orange" }<br>
ListItem { fruit: "lemon" }<br>
ListItem { fruit: "lychee" }<br>
ListItem { fruit: "apricots" }<br>
}<br>
delegate: Item {<br>
width: GridView.view.width<br>
height: Theme.itemSizeSmall<br>
<br>
Label { text: fruit }<br>
}<br>
}<br>
<br>
fails with the following error:
<meta name="qrichtext" content="1">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>ListElement: cannot contain nested elements<br>
<br>
I think it should rather read as:<br>
<br>
import QtQuick 2.0<br>
import Sailfish.Silica 1.0<br>
<br>
SilicaGridView {<br>
width: 480; height: 800<br>
model: ListModel {<br>
ListElement { fruit: "jackfruit" }<br>
ListElement { fruit: "orange" }<br>
ListElement { fruit: "lemon" }<br>
ListElement { fruit: "lychee" }<br>
ListElement { fruit: "apricots" }<br>
}<br>
delegate: Item {<br>
width: GridView.view.width<br>
height: Theme.itemSizeSmall<br>
<br>
Label { text: fruit }<br>
}<br>
}<br>
<br>
which seems to work and is consistant with QML ListModel
documentation.<br>
<br>
Regards,<br>
Franck<br>
<br>
</body>
</html>