Json (C++) error
Solved
General and Desktop
-
Hello!
Before I added [] elements inside X1/X2/Y1/Y2 Coords, the following code was good:
QJsonArray maps = QJsonDocument::fromJson(val.toUtf8()).array();
But now, it gives back an empty array... How can I solve this problem? Thank u in advance!
Hi, and welcome!
@Szabii said in Json (C++) error:
But now, it gives back an empty array... How can I solve this problem?
Your JSON document contains errors (look closely at "Colors"). Copy and paste your document into https://jsonlint.com/ to locate the errors.
-
@JKSH said in Json (C++) error:
to locate the errors.
Or use the Qt Api: QJsonDocument::fromJson() and check for errors instead simply hoping that all goes fine.
-
Nice catch. I didnt see the missing ,
before i read the comment.