QmlDesigner: Set null value for the empty properties of json objects

Fixes: QDS-12211
Change-Id: I0b85c6fb2f059317ab412f083e2130e8c1cfb6b6
Reviewed-by: Shrief Gabr <shrief.gabr@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Ali Kianian
2024-03-13 14:35:22 +02:00
parent f3782aed90
commit fbb8bd89f9

View File

@@ -643,7 +643,9 @@ QString CollectionDetails::toJson() const
QJsonObject exportedElement;
for (int i = 0; i < valueCount; ++i) {
const QJsonValue &value = record.at(i);
if (!isEmptyJsonValue(value))
if (isEmptyJsonValue(value))
exportedElement.insert(d->properties.at(i).name, QJsonValue::Null);
else
exportedElement.insert(d->properties.at(i).name, value);
}