Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.0 Beta1
-
None
-
Windows 10 x64, VS2019
-
ddc7b3c1565b5f7100df4d13e5501f76db2730ee (qt/qtbase/5.15)
Description
Copying values in QJsonObjects sometimes doesn't work:
Working example:
QJsonObject obj; obj["prop1"] = "TEST"; qDebug() << "OBJ 1:" << obj << obj.value("prop1"); obj["prop2"] = obj.value("prop1"); qDebug() << "OBJ 2:" << obj;
Result:
OBJ 1: QJsonObject({"prop1":"TEST"}) QJsonValue(string, "TEST")
OBJ 2: QJsonObject({"prop1":"TEST","prop2":"TEST"})
Small modifications will break it:
QJsonObject obj; obj["value"] = "TEST"; qDebug() << "OBJ 1:" << obj << obj.value("value"); obj["prop2"] = obj.value("value"); qDebug() << "OBJ 2:" << obj;
Result:
OBJ 1: QJsonObject({"value":"TEST"}) QJsonValue(string, "TEST")
OBJ 2: QJsonObject({"prop2":"","value":"TEST"})
Attachments
Issue Links
- resulted in
-
QTBUG-83398 Flaw in QJsonObject makes inserting values from the same object fail
- Open