07-19-2012 07:55 AM
Can anyone point me to further resources and examples on how to use JsonDataAccess to parse certain json data and display it in a ListView?
I have been trying all sorts of methods and none work.
If I simply wanted to show a list of items that are clickable and display more information, would a QListDataModel be the right choice?
Thank you!
07-19-2012 08:40 AM
Have you looked at stampcollector and weatherguesser yet? These should do what you want.
Stuart
07-19-2012 09:42 AM
I've tried copying those examples but I still get issues.
I directly copied the code from: https://developer.blackberry.com/cascades/referenc
but I get the following issue:
../src/MenuHandler.cpp:71:66: error: no matching function for call to 'bb::data::JsonDataAccess::load(QString)'
even though in the API it exists:
QVariant load (const QString &filePath)
Here is my code:
JsonDataAccess jda;
QVariant mainList = jda.load(QString::fromStdString("test.json"));
GroupDataModel *model = new GroupDataModel(QStringList() << "region");
model->insert(mainList);
myEventsLSTVW = new ListView();
myEventsLSTVW->setDataModel(model);
Any suggestions? Thanks!
07-19-2012 11:43 AM
Have you switched to Beta2?
Stuart
07-19-2012 12:29 PM
+1 for this issue. Just imported an app created in Beta 1, made the changes recommended in the Upgrade To Beta 2 guide, and I get the error undefined reference to `bb::data::JsonDataAccess::JsonDataAccess(QObject*
07-19-2012 01:22 PM
You need to add the corresponding library in your .pro file:
LIBS += -lbbdata
Stuart
07-20-2012 03:59 AM
07-23-2012 07:43 AM
As for the original question:
Were the samples enough to answer your question?
Stuart
08-28-2012 05:34 AM - edited 08-28-2012 05:35 AM
Hi,
You should add LIBS += -lbbdata to ur .pro file in ur project all the classes regarding JsonDataAccess are stored in bb::data namespace.so inorder to access these classes u need to add LIBS += -lbbdata to ur .pro file in ur application.
Regards,
Naresh Kodumuri.