I am using the following code for parsing.
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();
}
My json String is "[{"id":2,"name":"AAA"},{"id":1,"name":"BBB"}].
I got the following error:'class QVariantMap' has no member named 'toList'. is it possible to convert the QMap to QList*strong text*
Please help me. Thanks in advacne.