Strange Json issue, conversion from QByteArray to QJsonDocument not working as intended
-
@DanBar said in Strange Json issue, conversion from QByteArray to QJsonDocument not working as intended:
"Json error: illegal number"
what does that mean?possibly an integer/decimal value beginning with
0
(e.g.propertyName: 01234
)? unless it's an octal value. -
@raven-worx There are many values that are 0 and a few values that are decimal, are those allowed while running in Qtcreator but not as an installed program?
a sample part of the json:
"name": "Test 4",
"valueA": 180,
"valueB": "",
"valueC": 9,
"valueD": 1,
"valueE": 0.8869204367,
"valueF": 1500,
"valueG": "C",
"valueH": 0,
"valueI": "16d29c44-3d0941",
"valueJ": "1392fa45-68c943",
"valueK": "2018-08-06 09:07:29", -
@DanBar
Hi
You you also output
http://doc.qt.io/qt-5/qjsonparseerror.html#offset-var
as it gives a clue where in the file it gets error. -
@DanBar said in Strange Json issue, conversion from QByteArray to QJsonDocument not working as intended:
There are many values that are 0 and a few values that are decimal, are those allowed while running in Qtcreator but not as an installed program?
a sample part of the json:
"name": "Test 4",
"valueA": 180,
"valueB": "",
"valueC": 9,
"valueD": 1,
"valueE": 0.8869204367,
"valueF": 1500,
"valueG": "C",
"valueH": 0,
"valueI": "16d29c44-3d0941",
"valueJ": "1392fa45-68c943",
"valueK": "2018-08-06 09:07:29",none of those values should raise this error as far i see.
I was talking about decimals bigger than0
. So 0 is of course a valid decimal value, but02934
notBut you havent answered my first question. Are you sure you already received the full data before you start to parse the JSON data?!
-
Hi,
How long is the long array that makes things fail ?
See QTBUG-47629 for a limitation on QJsonObject's size.
-
Thank you all for your help!
I was able to solve this issue, but the problem wasn't in the Json itself. I got a tip a tip from my colleague to check the .dll-files in the installation folder, and I noticed that they weren't entirely up to date. When I replaced them with the correct version of .dll-files the issue was solved. I still don't know exactly what caused this issue between the versions (version 5.9 and 5.10) but the issue is solved so I'm happy in either case.
Again, thanks!
-
@DanBar said in Strange Json issue, conversion from QByteArray to QJsonDocument not working as intended:
installation folder
Which installation folder do you mean? Qt? Your app?