6.0.0-rc4Source

QJsonObject::iterator Class

The QJsonObject::iterator class is an STL-style non-const iterator for QJsonObject. More…

Header#include <QJsonObject>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
Nested inQJsonObject

List of all members, including inherited members

Public Types

typedefiterator_category
typedefdifference_type
typedefvalue_type
typedefreference
typedefpointer

Public Functions

iterator()
iterator(QJsonObject *object, qsizetype index)
QStringkey() const
QAnyStringViewkeyView() const
QJsonValueRefvalue() const
QJsonValueRefoperator*() const
QJsonRefArrow<QJsonValueRef>operator->() const
QJsonValueRefoperator[](qsizetype j) const
booloperator==(const iterator &other) const
booloperator!=(const iterator &other) const
booloperator<(const iterator &other) const
booloperator<=(const iterator &other) const
booloperator>(const iterator &other) const
booloperator>=(const iterator &other) const
booloperator==(const const_iterator &other) const
booloperator!=(const const_iterator &other) const
booloperator<(const const_iterator &other) const
booloperator<=(const const_iterator &other) const
booloperator>(const const_iterator &other) const
booloperator>=(const const_iterator &other) const
iterator &operator++()
iteratoroperator++(int)
iterator &operator--()
iteratoroperator--(int)
iterator &operator+=(qsizetype j)
iterator &operator-=(qsizetype j)
iteratoroperator+(qsizetype j) const
iteratoroperator-(qsizetype j) const
qsizetypeoperator-(const iterator &other) const

Detailed Description

A random access iterator over the entries of an object, in the sorted order of their keys. key() returns the key and the dereferenced value is a QJsonValueRef.

See also QJsonObject::const_iterator.

Member Type Documentation

typedef QJsonObject::iterator::difference_type

Alias for qsizetype.

typedef QJsonObject::iterator::iterator_category

Marks the iterator as a random access iterator.

typedef QJsonObject::iterator::pointer

The type operator->() returns.

typedef QJsonObject::iterator::reference

Alias for QJsonValueRef.

typedef QJsonObject::iterator::value_type

Alias for QJsonValue.

Member Function Documentation

QJsonObject::iterator::iterator()

Creates an iterator that refers to no object.

[explicit] QJsonObject::iterator::iterator(QJsonObject *object, qsizetype index)

Creates an iterator that refers to entry index of object.

QString QJsonObject::iterator::key() const

Returns the key of the current entry.

QAnyStringView QJsonObject::iterator::keyView() const

Returns a view of the key of the current entry, without copying it. The view is valid until a key is inserted into the object or removed from it.

This function was introduced in 6.10.

See also key().

bool QJsonObject::iterator::operator!=(const iterator &other) const

Returns true if other refers to another entry.

bool QJsonObject::iterator::operator!=(const const_iterator &other) const

This is an overloaded function.

QJsonValueRef QJsonObject::iterator::operator*() const

Returns a reference to the value of the current entry.

iterator QJsonObject::iterator::operator+(qsizetype j) const

Returns an iterator j entries after this one.

iterator & QJsonObject::iterator::operator++()

Advances the iterator to the next entry and returns it.

iterator QJsonObject::iterator::operator++(int)

This is an overloaded function.

Advances the iterator and returns its previous position.

iterator & QJsonObject::iterator::operator+=(qsizetype j)

Advances the iterator by j entries and returns it.

iterator QJsonObject::iterator::operator-(qsizetype j) const

This is an overloaded function.

Returns an iterator j entries before this one.

qsizetype QJsonObject::iterator::operator-(const iterator &other) const

This is an overloaded function.

Returns the number of entries between other and this iterator.

iterator & QJsonObject::iterator::operator--()

Moves the iterator to the previous entry and returns it.

iterator QJsonObject::iterator::operator--(int)

This is an overloaded function.

Moves the iterator back and returns its previous position.

iterator & QJsonObject::iterator::operator-=(qsizetype j)

Moves the iterator back by j entries and returns it.

QJsonRefArrow<QJsonValueRef> QJsonObject::iterator::operator->() const

Returns a pointer-like helper for the value of the current entry.

bool QJsonObject::iterator::operator<(const iterator &other) const

Returns true if this iterator is before other.

bool QJsonObject::iterator::operator<(const const_iterator &other) const

This is an overloaded function.

bool QJsonObject::iterator::operator<=(const iterator &other) const

Returns true if this iterator is before or at the same position as other.

bool QJsonObject::iterator::operator<=(const const_iterator &other) const

This is an overloaded function.

bool QJsonObject::iterator::operator==(const iterator &other) const

Returns true if other refers to the same entry.

bool QJsonObject::iterator::operator==(const const_iterator &other) const

This is an overloaded function.

bool QJsonObject::iterator::operator>(const iterator &other) const

Returns true if this iterator is after other.

bool QJsonObject::iterator::operator>(const const_iterator &other) const

This is an overloaded function.

bool QJsonObject::iterator::operator>=(const iterator &other) const

Returns true if this iterator is after or at the same position as other.

bool QJsonObject::iterator::operator>=(const const_iterator &other) const

This is an overloaded function.

QJsonValueRef QJsonObject::iterator::operator[](qsizetype j) const

Returns a reference to the value of the entry j positions after the current one.

QJsonValueRef QJsonObject::iterator::value() const

Returns a reference to the value of the current entry.