[Qt-interest] Parsing JSON with QT using standard QT library dosn't work
Diego Iastrubni
diegoiast at gmail.com
Thu Mar 25 15:02:44 CET 2010
... or...
Using a more "native" solution:
http://qjson.sourceforge.net/
http://flavio.castelli.name/qjson_qt_json_library
On Thu, Mar 25, 2010 at 9:41 AM, Meir Yanovich <meiry242 at gmail.com> wrote:
> Hello all
> im trying to fallow the tutorial on which explains how to parse json
> key/value but it always gives me parsing error
> and i have no idea why , here is the code :
> QString http_response =
> "{\"key\":\"a99fdd865c2-10000\",\"oid\":1000055,\"expires\":0000,\"secret\":\"509c03edfdc7\",\"sign\":\"f0dd9e5226d0e77\"}";
> QScriptValue sc;
> QScriptEngine engine;
> sc = engine.evaluate(http_response);
> QString hhh = sc.toString();
>
> if (!sc.property("key").isNull())
> {
> QStringList items;
> qScriptValueToSequence(sc, items);
> // LogToFile("--------JSON RESPONSE ------");
> foreach (QString str, items) {
> // LogToFile(str);
> QString ggg = str;
> }
> }
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100325/32c843e2/attachment.html
More information about the Qt-interest-old
mailing list