开发者

Install QJson in Mac

开发者 https://www.devze.com 2023-01-16 02:26 出处:网络
How to install the Qjson i开发者_StackOverflown mac?Refer to the \"get it\" tab on the QJson website. MacOs X is a Unix system

How to install the Qjson i开发者_StackOverflown mac?


Refer to the "get it" tab on the QJson website. MacOs X is a Unix system

Edit for parsing:

Try this for your Json string "[{"id":2,"name":"AAA"},{"id":1,"name":"BBB"}]"

QJson::Parser parser;
bool ok;
QVariantMap result=parser.parse (cityReply->readAll(),&ok).toMap();
if (!ok)
{
    qFatal("An error occurred during parsing");
    exit (1);
}

foreach (QVariant city, result.toList())
{
    QVariantMap names = city.toMap();
    qDebug() << "\t-" << names["name"].toString();
}

Please open a new Question if you have an other question.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号