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

QJsonValue::toObject(const QJsonObject &defaultValue) and QJsonValue::toArray(const QJsonArray &defaultValue) parse empty default values incorrectly

    XMLWordPrintable

Details

    • e114fec62a (qt/qtbase/dev) e114fec62a (qt/tqtc-qtbase/dev) 8b8cb92674 (qt/tqtc-qtbase/6.2) f7eada3203 (qt/qtbase/6.3) f3abda4836 (qt/qtbase/6.4) f7eada3203 (qt/tqtc-qtbase/6.3) f3abda4836 (qt/tqtc-qtbase/6.4) 8b8cb92674 (qt/tqtc-qtbase/6.2.5)

    Description

      The added check in commit 35adb74ddd915831789f0175423660f8e898942e

      "n >= 0" seems to be incorrect.

       

      small example:

      const auto obj = QJsonObject{
      
      { "key", QJsonArray() }
      
      };
      
      const auto x = obj.value( "key" ).toArray( QJsonArray{ "default" } );
      

       

      x should have the value QJsonArray() , but it will have the value QJsonArray{ "default" }

      Attachments

        For Gerrit Dashboard: QTBUG-104085
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            aschmidt Adrian Schmidt-Föhre
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: