Details
-
Suggestion
-
Resolution: Incomplete
-
P3: Somewhat important
-
5.1.0 Beta 1
-
None
Description
Currently creating QJsonObject instance from a network response is sub-optimal.
QNetworkReply is a QIODevice, but QJsonDocument accepts only QByteArray. Therefore code needs to construct a temporary array only for parsing. It looks like that:
QJsonObject data = QJsonDocument::fromJson(reply->readAll()).object();
I would prefer to not allocate space for json twice, especially that it may be big.