03-04-2013 09:27 AM
ListView* list = m_root->findChild<ListView*>("List");
ArrayDataModel *model = new ArrayDataModel;
for(int count = 0; count < 2; count ++)
{
data1 = jsonva.toMap()["Items"].toList()[count].toMap()["C
data2 = jsonva.toMap()["tems"].toList()[count].toMap()["De
data3 = jsonva.toMap()["Items"].toList()[count].toMap()["D
map["Caption"] = data1;
map["Description"] = data2;
map["Date"] = data3;
model->insert(map);
}
list->setDataModel(model);
With the above code, I can only see caption on my listview whereas Description and Date are missing. Any help ?
When I tried GroupDataModel instaed of ArrayDataModel, it seems to work as expected but I need unsorted data models such as ArrayDataModel.
03-04-2013 09:38 AM
03-04-2013 09:57 AM - edited 03-04-2013 10:14 AM
Container{
id: listViewItem
visible: true
background : Color.White
layout : DockLayout {
}
ListView {
verticalAlignment : VerticalAlignment.Center
id: List
objectName: "List"
listItemComponents: [
ListItemComponent {
type: "item"
StandardListItem {
title: ListItemData.Caption
description: ListItemData.Description
status: ListItemData.Date
}
}
] // end of listItemComponents list
}
}
Its a copy-pasted code. I assigned a predifined strings and It still didnt work. I am able to print data I retrieve on a log file. So data is not a problem. Am I missing something on QML file?
03-06-2013 02:57 AM