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

QVariantMap conversion to QJsonDocument behaviour change

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None

      Description

      a QVariantMap keypair that has value of QVariant is ignored when converting to QJsonDocument.

       

      QVariantMap m{{"toto", QVariant{}}}; 

      qDebug() << m;  // m contains toto with the null QVariant

      qDebug() << QJsonDocument::fromVariant(m); // this one is empty

       

      I was trying to port from Qt 5.12 to 5.15 and that is a real bummer.

       

      Is this behaviour change intended?

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              sonakur Sona Kurazyan
              Reporter:
              thierryb Thierry Bastian
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes