Hi all,
How to parse JSON (JavaScript Object Notation) data-interchange format in Qt?
Can somebody give hints on it?
Thanks,
Raajesh
Hi all,
How to parse JSON (JavaScript Object Notation) data-interchange format in Qt?
Can somebody give hints on it?
Thanks,
Raajesh
Hi.
I want to know, either. Can somebody tell us how to do?
thx
Hi,
Everything you need...
http://qtwiki.org/Parsing_JSON_with_...ard_QT_library
Hi Guys
i been at this for over 3 hours and dont understand why I cannot get it to work. I have done the examples time and time again, but still no luck!
Anyone shed any light to whats going on?
Thanks!!
#include <QtGui/QApplication>
#include <QScriptValue>
#include <QScriptEngine>
#include <QDebug>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QString result = "{\"result\":[1,2,3]}";
QScriptValue sc;
QScriptEngine engine;
sc = engine.evaluate(result);
if (sc.property("result").isArray())
{
QStringList items;
qScriptValueToSequence(sc.property("result"), items);
foreach (QString str, items) {
qDebug() << str.toStdString().c_str();
}
}
else
{
qDebug() << "It's not an array";
}
return a.exec();
}
try the QJson library, to parse JSON. very useful.
http://flavio.castelli.name/qjson_qt_json_library
Girija (13th September 2010)
I also be there
Parsing_JSON_with_QT_using_standard_QT_library
And of course I think that now I'm quickly copy-paste and all works....
But now 1:39 and I finished ))) My project alive only after install QJson library. Very powerful library. Respect!
Girija (13th September 2010)
Bookmarks