Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31178

Add QJsonDocument::fromJson(QIODevice*, QJsonParseError *error = 0);

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incomplete
    • P3: Somewhat important
    • 5.2.0
    • 5.1.0 Beta 1
    • Core: Other
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            nierob Nierob
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes