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

[Reg 5.14.2->5.15.0] QJsonObject::erase not working properly

    XMLWordPrintable

Details

    • 9e83d268d6e0bd492fafad823a47cef57b7916c5 (qt/qtbase/5.15.0)

    Description

      Erase function of QJsonObject delete the wrong (key, value) pair in 5.15.0 beta4, It is working fine with 5.14.x.

      Please refer to the attached sample where a test.json is parsed using QJsonObject. On erasing the pair with key as "xyz", It deleted the wrong pair with key as "test1".

      {
      	"Arr1": 
      	[
      		{
      			"Count": 1,
      			"Arr2": 
      			[
      				{
                "xyz": "data2",
                "test1": "data1",
                "Arr3" :
                [
                  {
                    "abc": "data3",
                    "test2" : 1
                  }
                ]
      				}
      			]
      		}
      	]
      }
      

      Output in Qt 5.15.0 :

      Before erase propData =  QJsonObject({"Arr3":[{"abc":"data3","test2":1}],"test1":"data1","xyz":"data2"})
      propfind key =  "xyz"
      propfind value =  QJsonValue(string, "data2")
      After erase propData = QJsonObject({"Arr3":[{"abc":"data3","test2":1}],"xyz":"data2"})
      Test finished
      

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            shmittal Shveta Mittal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes