QAssociativeIterable::const_iterator Class
The const_iterator class is a read-only iterator over a QAssociativeIterable. More…
| Header | #include <QAssociativeIterable> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Nested in | QAssociativeIterable |
List of all members, including inherited members
Public Types
| typedef | iterator_category |
| typedef | difference_type |
| typedef | value_type |
| typedef | pointer |
| typedef | reference |
Public Functions
| const_iterator() | |
| QVariant | key() const |
| QVariant | value() const |
| QVariant | operator*() const |
| bool | operator==(const const_iterator &o) const |
| bool | operator!=(const const_iterator &o) const |
| const_iterator & | operator++() |
| const_iterator | operator++(int) |
| const_iterator & | operator--() |
| const_iterator | operator--(int) |
Detailed Description
key() and value() return the key and the mapped value of the current entry as QVariant objects.
Differences from Qt
The iterator is addressed by position, so advancing an iterator over a hash takes time proportional to the position.
Member Type Documentation
typedef QAssociativeIterable::const_iterator::difference_type
The type of the difference between two iterators.
typedef QAssociativeIterable::const_iterator::iterator_category
The category of the iterator for the standard library.
typedef QAssociativeIterable::const_iterator::pointer
The pointer type of the values.
typedef QAssociativeIterable::const_iterator::reference
The type that dereferencing the iterator returns: a QVariant by value.
typedef QAssociativeIterable::const_iterator::value_type
The type of the values: QVariant.
Member Function Documentation
QAssociativeIterable::const_iterator::const_iterator()
Constructs an iterator that does not refer to a container.
QVariant QAssociativeIterable::const_iterator::key() const
Returns the key of the entry that the iterator refers to.
See also value().
bool QAssociativeIterable::const_iterator::operator!=(const const_iterator &o) const
Returns true if o refers to a different entry or container.
QVariant QAssociativeIterable::const_iterator::operator*() const
Returns the mapped value of the current entry. This is the same as value().
const_iterator & QAssociativeIterable::const_iterator::operator++()
Advances the iterator by one entry and returns a reference to it.
const_iterator QAssociativeIterable::const_iterator::operator++(int)
This is an overloaded function.
Advances the iterator by one entry and returns its previous position.
const_iterator & QAssociativeIterable::const_iterator::operator--()
Moves the iterator back by one entry and returns a reference to it.
const_iterator QAssociativeIterable::const_iterator::operator--(int)
This is an overloaded function.
Moves the iterator back by one entry and returns its previous position.
bool QAssociativeIterable::const_iterator::operator==(const const_iterator &o) const
Returns true if o refers to the same entry of the same container.
QVariant QAssociativeIterable::const_iterator::value() const
Returns the mapped value of the entry that the iterator refers to.
See also key().