Doc: update QJsonObject::operator[] non-const to say it creates key

the non-const QJsonArray::operator[] requires a valid index and all the
const operator[] say that it returns Undefined if the key or index
doesn't exist. This is the exception.

Task-number: QTBUG-39864
Change-Id: Iaa63461109844e978376fffd15f9716f0cc66cca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Thiago Macieira 2020-03-05 07:17:45 -08:00 committed by Lars Knoll
parent d41d8297c8
commit c798b286bd
1 changed files with 3 additions and 1 deletions

View File

@ -401,7 +401,9 @@ QJsonValue QJsonObject::operator [](const QString &key) const
#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a reference to the value for \a key.
Returns a reference to the value for \a key. If there is no value with key
\a key in the object, one is created with a QJsonValue::Null value and then
returned.
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can