QJsonDocument from json

Viewed 2416

I have a binary string with JSON object that I need to parse. But when I create QJsonDocument from it I get an empty document. I've tried to read an error code after creating but QJsonParseError contains "NoError". JSON that I want to parse is too large, but when I try to create small json and parse it I end up with same result. My short example:

QJsonDocument doc;
QString json("{\"key\" : \"value\"}");
QJsonParseError error;
doc.fromJson(json.toUtf8(), &error);
1 Answers
Related