[Qt-interest] Parsing JSON with QT using standard QT library dosn't work

Meir Yanovich meiry242 at gmail.com
Thu Mar 25 08:41:45 CET 2010


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;
             }
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100325/13f6a862/attachment.html 


More information about the Qt-interest-old mailing list