Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
A suggestion to QJson related classes...
Kimi Arthur last edited by
Typically I write the following to retrieve data from a json document:
This is great, but is quite "textful". I believe the following will be better code:
which removes all the type conversion part.
And I believe this is possible with the current settings. Because we have methods like isArray, isObject etc, the framework actually knows the internal type of the QJsonValue, so we can return the value accordingly, like:
QJsonValue QJsonValue::operator(int i)
QJsonValue QJsonValue::operator(QString s)
And this will simplify the written code quite a lot!
I'm not using QJson*, so I don't feel strongly either way. Your proposal looks very much like 2D array, which might be confusing.
In any case, Qt developers rarely visit this forum (save for several exception). If you want to be heard by people who make Qt happen, write to "Development Mailing List":http://lists.qt-project.org/mailman/listinfo.