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

QVariantMap conversion to QJsonDocument behaviour change

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.0
    • Core: Other
    • None

      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?

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes