Tidy up QJsonObject documentation.
Change-Id: I445e0573c3c4fdb86ef535299a4eb299e225c15d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
1e47a9594c
commit
8b540f68a8
@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
QJsonObject is an implicitly shared class, and shares the data with the document
|
QJsonObject is an implicitly shared class, and shares the data with the document
|
||||||
it has been created from as long as it is not being modified.
|
it has been created from as long as it is not being modified.
|
||||||
|
|
||||||
You can convert the array to and from text based JSON through QJsonDocument.
|
You can convert the object to and from text based JSON through QJsonDocument.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Constructs an empty JSON object
|
Constructs an empty JSON object.
|
||||||
|
|
||||||
\sa isEmpty()
|
\sa isEmpty()
|
||||||
*/
|
*/
|
||||||
@ -245,7 +245,7 @@ bool QJsonObject::isEmpty() const
|
|||||||
/*!
|
/*!
|
||||||
Returns a QJsonValue representing the value for the key \a key.
|
Returns a QJsonValue representing the value for the key \a key.
|
||||||
|
|
||||||
The returned QJsonValue is \c Undefined, if the key does not exist.
|
The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
|
||||||
|
|
||||||
\sa QJsonValue, QJsonValue::isUndefined()
|
\sa QJsonValue, QJsonValue::isUndefined()
|
||||||
*/
|
*/
|
||||||
@ -266,7 +266,7 @@ QJsonValue QJsonObject::value(const QString &key) const
|
|||||||
|
|
||||||
This does the same as value().
|
This does the same as value().
|
||||||
|
|
||||||
The returned QJsonValue is \c Undefined, if the key does not exist.
|
The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
|
||||||
|
|
||||||
\sa value(), QJsonValue, QJsonValue::isUndefined()
|
\sa value(), QJsonValue, QJsonValue::isUndefined()
|
||||||
*/
|
*/
|
||||||
@ -281,7 +281,7 @@ QJsonValue QJsonObject::operator [](const QString &key) const
|
|||||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
the assignment will apply to the element in the QJsonArray or QJsonObject
|
||||||
from which you got the reference.
|
from which you got the reference.
|
||||||
|
|
||||||
\sa value()
|
\sa value()
|
||||||
@ -301,13 +301,13 @@ QJsonValueRef QJsonObject::operator [](const QString &key)
|
|||||||
/*!
|
/*!
|
||||||
Inserts a new item with the key \a key and a value of \a value.
|
Inserts a new item with the key \a key and a value of \a value.
|
||||||
|
|
||||||
If there is already an item with the key \a key then that item's value
|
If there is already an item with the key \a key, then that item's value
|
||||||
is replaced with \a value.
|
is replaced with \a value.
|
||||||
|
|
||||||
Returns an iterator pointing to the inserted item.
|
Returns an iterator pointing to the inserted item.
|
||||||
|
|
||||||
If the value is QJsonValue::Undefined, it will cause the key to get removed
|
If the value is QJsonValue::Undefined, it will cause the key to get removed
|
||||||
from the object. The returned iterator will then point to end()
|
from the object. The returned iterator will then point to end().
|
||||||
|
|
||||||
\sa remove(), take(), QJsonObject::iterator, end()
|
\sa remove(), take(), QJsonObject::iterator, end()
|
||||||
*/
|
*/
|
||||||
@ -382,7 +382,7 @@ void QJsonObject::remove(const QString &key)
|
|||||||
|
|
||||||
Returns a QJsonValue containing the value referenced by \a key.
|
Returns a QJsonValue containing the value referenced by \a key.
|
||||||
If \a key was not contained in the object, the returned QJsonValue
|
If \a key was not contained in the object, the returned QJsonValue
|
||||||
is Undefined.
|
is QJsonValue::Undefined.
|
||||||
|
|
||||||
\sa insert(), remove(), QJsonValue
|
\sa insert(), remove(), QJsonValue
|
||||||
*/
|
*/
|
||||||
@ -422,7 +422,7 @@ bool QJsonObject::contains(const QString &key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns \c true if \a other is equal to this object
|
Returns \c true if \a other is equal to this object.
|
||||||
*/
|
*/
|
||||||
bool QJsonObject::operator==(const QJsonObject &other) const
|
bool QJsonObject::operator==(const QJsonObject &other) const
|
||||||
{
|
{
|
||||||
@ -447,7 +447,7 @@ bool QJsonObject::operator==(const QJsonObject &other) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns \c true if \a other is not equal to this object
|
Returns \c true if \a other is not equal to this object.
|
||||||
*/
|
*/
|
||||||
bool QJsonObject::operator!=(const QJsonObject &other) const
|
bool QJsonObject::operator!=(const QJsonObject &other) const
|
||||||
{
|
{
|
||||||
@ -501,7 +501,7 @@ QJsonObject::iterator QJsonObject::find(const QString &key)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns an const iterator pointing to the item with key \a key in the
|
Returns a const iterator pointing to the item with key \a key in the
|
||||||
map.
|
map.
|
||||||
|
|
||||||
If the map contains no item with key \a key, the function
|
If the map contains no item with key \a key, the function
|
||||||
@ -594,7 +594,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
should use QJsonObject::const_iterator. It is generally good practice to
|
should use QJsonObject::const_iterator. It is generally good practice to
|
||||||
use QJsonObject::const_iterator on a non-const QJsonObject as well, unless you
|
use QJsonObject::const_iterator on a non-const QJsonObject as well, unless you
|
||||||
need to change the QJsonObject through the iterator. Const iterators are
|
need to change the QJsonObject through the iterator. Const iterators are
|
||||||
slightly faster, and improves code readability.
|
slightly faster, and improve code readability.
|
||||||
|
|
||||||
The default QJsonObject::iterator constructor creates an uninitialized
|
The default QJsonObject::iterator constructor creates an uninitialized
|
||||||
iterator. You must initialize it using a QJsonObject function like
|
iterator. You must initialize it using a QJsonObject function like
|
||||||
@ -614,8 +614,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
|
|
||||||
/*! \typedef QJsonObject::iterator::iterator_category
|
/*! \typedef QJsonObject::iterator::iterator_category
|
||||||
|
|
||||||
A synonym for \e {std::bidirectional_iterator_tag} indicating
|
A synonym for \e {std::bidirectional_iterator_tag} indicating
|
||||||
this iterator is a bidirectional iterator.
|
this iterator is a bidirectional iterator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \typedef QJsonObject::iterator::reference
|
/*! \typedef QJsonObject::iterator::reference
|
||||||
@ -664,7 +664,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
the assignment will apply to the element in the QJsonArray or QJsonObject
|
||||||
from which you got the reference.
|
from which you got the reference.
|
||||||
|
|
||||||
\sa key(), operator*()
|
\sa key(), operator*()
|
||||||
@ -679,7 +679,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
the assignment will apply to the element in the QJsonArray or QJsonObject
|
||||||
from which you got the reference.
|
from which you got the reference.
|
||||||
|
|
||||||
\sa key()
|
\sa key()
|
||||||
@ -788,7 +788,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
over it, you must use QJsonObject::iterator instead. It is generally
|
over it, you must use QJsonObject::iterator instead. It is generally
|
||||||
good practice to use QJsonObject::const_iterator on a non-const QJsonObject as
|
good practice to use QJsonObject::const_iterator on a non-const QJsonObject as
|
||||||
well, unless you need to change the QJsonObject through the iterator.
|
well, unless you need to change the QJsonObject through the iterator.
|
||||||
Const iterators are slightly faster and improves code
|
Const iterators are slightly faster and improve code
|
||||||
readability.
|
readability.
|
||||||
|
|
||||||
The default QJsonObject::const_iterator constructor creates an
|
The default QJsonObject::const_iterator constructor creates an
|
||||||
@ -809,8 +809,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
|
|||||||
|
|
||||||
/*! \typedef QJsonObject::const_iterator::iterator_category
|
/*! \typedef QJsonObject::const_iterator::iterator_category
|
||||||
|
|
||||||
A synonym for \e {std::bidirectional_iterator_tag} indicating
|
A synonym for \e {std::bidirectional_iterator_tag} indicating
|
||||||
this iterator is a bidirectional iterator.
|
this iterator is a bidirectional iterator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \typedef QJsonObject::const_iterator::reference
|
/*! \typedef QJsonObject::const_iterator::reference
|
||||||
|
Loading…
x
Reference in New Issue
Block a user