Install QJson on Mac

How to install Qjson on mac?

+3
source share
1 answer

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

Edit for parsing:

Try this for your Json line: "[{" 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 another question.

+1
source

Source: https://habr.com/ru/post/1764445/


All Articles