Json (C++) error
Solved
General and Desktop
-
wrote on 25 Jan 2020, 13:49 last edited by
-
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. -
wrote on 25 Jan 2020, 17:04 last edited by
Thanks the help! Really worked :D Kinda new in Json.
1/5