Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.2.2
-
None
-
Fedora Linux 35, GCC 11.2.1
Description
I have following codes for parsing a JSON file containing an array:
QString TP_PlaylistWindow::createPlaylistFromJSON( const QJsonDocument &I_jDoc ) { qDebug() << "I_jDoc:" << I_jDoc; auto jArray_Root { I_jDoc.array() }; qDebug() << "jArray_Root:" << jArray_Root; ...
The output result is:
I_jDoc: QJsonDocument([{"fileList":[],"listName":"Default"},{"fileList":[],"listName":"List 2"}]) jArray_Root: QJsonArray([[{"fileList":[],"listName":"Default"},{"fileList":[],"listName":"List 2"}]])
And you can see that the returned QJsonArray was encapsulated by array brackets [] once again, which was not expected since I need to take off the extra array brackets before interpreting the real array.
I also observed a similar phenomenon on QJsonValue::toArray(). Is this mechanism intended?
Attachments
Issue Links
- duplicates
-
QTBUG-112727 GCC/Clang differences on QJsonValue initialization
- Closed