i'm developing blackberry 10 app. i have some trouble using GroupDataModel.
this is the code :
GroupDataModel *searchModel;
if (searchModel != NULL){
qDebug() << "Masuk sini";
searchModel->clear();
}
searchModel = new GroupDataModel(
new QListDataModel<QString>(
QList<QString>() << "suburbName" ));
QVariantMap map;
for (int i = 0; i < list.size(); ++i) {
QVariantMap x = list.at(i).toMap();
map["suburbName"] = x.value("address").toString();
qDebug() << x;
qDebug() << map;
searchModel->insert(map);
}
searchList->resetDataModel();
searchModel->setGrouping(ItemGrouping::None);
searchList->setDataModel(searchModel);
this code called not just once. so when it's called i have to clear the GroupDataModel. but it's always crash. and when i debug, the problem is when searchModel->clear(); i've already tried replacing that with free(searchModel) but the crash still happen.
the crash says : Segmentation Fault
someone please help me! i've been struggling with this problem for several days.
Thanks
Regards, Yoga