-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.7.0
-
None
code example:
QJsonObject testObject; qInfo() << testObject["keyname"].isUndefined() << testObject["keyname"].type();
This is code print "false 0".
where "false" is result of testObject["keyname"].isUndefined()
"0" is result of testObject["keyname"].type() and equal QJsonValue::Null
In documention printed:
QJsonValue QJsonObject::operator[](const QString &key) const
Returns a QJsonValue representing the value for the key key.
This does the same as value().
The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
But returned value have type QJsonValue::Null, not QJsonValue::Undefined.
- Š’ehavior does not comply with the documentation;
- In some case QJsonValue::Null is correct value of object property.
Sorry for my english