Using Qt-5.0, I have this JSON string
{"type":"FILE"}
I expected fromBinaryData accept .toLocal8Bit() strings as a valid format, but it is not.
QString j = "{\"type\":\"FILE\"}"; auto doc = QJsonDocument::fromBinaryData(j.toLocal8Bit()); doc.isNull() // It true, means the entry is not valid
Did I miss something?
source share