12-29-2012 05:27 AM
Hi, I have the following XML:
<Parkings version="1.0" timestamp="1356710328"> <parkings name="P02" description="Reep" address="Seminariestraat 9,<br>9000 Gent" contactInfo="Tel.: 09 266 29 50" openingHours="24/24 open" open="1" totalCapacity="470" availableCapacity="100" latitude="51.052" longitude="3.731" covered="1"> <activeRoute/> </parkings> <parkings name="P04" description="Kouterpoort" address="Savaanstraat 13,<br>9000 Gent" contactInfo="Tel.: 09 266 29 40" openingHours="24/24 open" open="1" totalCapacity="570" availableCapacity="570" latitude="51.049" longitude="3.724" covered="1"> <activeRoute/> </parkings> <parkings name="P08" description="Ramen" address="Ramen 23,<br>9000 Gent" contactInfo="Tel.: 09 266 29 70" openingHours="24/24 open" open="1" totalCapacity="270" availableCapacity="45" latitude="51.056" longitude="3.716" covered="1"> <activeRoute/> </parkings> <parkings name="P07" description="Sint-Michiels" address="Sint-Michielsplein 8,<br>9000 Gent" contactInfo="Tel.: 09 266 29 20" openingHours="24/24 open" open="1" totalCapacity="460" availableCapacity="35" latitude="51.053" longitude="3.719" covered="1"> <activeRoute/> </parkings> <parkings name="P01" description="Vrijdagmarkt" address="Vrijdagmarkt 1,<br>9000 Gent" contactInfo="Tel.: 09 266 29 00 <br> (permanentie)<br> Tel.: 09 266 29 01 <br> (tijdens kantooruren)" openingHours="24/24 open" open="1" totalCapacity="629" availableCapacity="95" latitude="51.057" longitude="3.726" covered="1"> <activeRoute/> </parkings> <parkings name="P10" description="Sint-Pietersplein" address="Sint-Pietersplein 65,<br>9000 Gent" contactInfo="Tel.: 09 266 29 60" openingHours="24/24 open" open="1" totalCapacity="697" availableCapacity="70" latitude="51.042" longitude="3.726" covered="1"> <activeRoute/> </parkings> </Parkings>
It doesn't get displayed properly, although I use code mostly out of a tutorial. This is the code:
XmlDataModel *dataModel = new XmlDataModel();
dataModel->setSource(QUrl("file://" + QDir::homePath() + "/parkings.xml"));
So I pretty much download the XML, write it to a file and then open it using the XmlDataModel. However nothing is displayed in the ListView with the following ListItemComponents:
listItemComponents: [
ListItemComponent {
type: "parkings"
StandardListItem {
title: ListItemData.name
}
}
]
What am I doing wrong?
Solved! Go to Solution.
12-29-2012 08:17 AM