Solved Json (C++) error
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!
JKSH Moderators last edited by
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.
Christian Ehrlicher Lifetime Qt Champion last edited by
@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.
mrjj Lifetime Qt Champion last edited by
Nice catch. I didnt see the missing ,
before i read the comment.
Thanks the help! Really worked :D Kinda new in Json.