QSequentialIterable::const_iterator Class
The const_iterator class is a read-only iterator over a QSequentialIterable. More…
| Header | #include <QSequentialIterable> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Nested in | QSequentialIterable |
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 | operator*() const |
| QVariant | operator[](qsizetype j) const |
| bool | operator==(const const_iterator &o) const |
| bool | operator!=(const const_iterator &o) const |
| bool | operator<(const const_iterator &o) const |
| bool | operator<=(const const_iterator &o) 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) |
| const_iterator & | operator+=(qsizetype j) |
| const_iterator & | operator-=(qsizetype j) |
| const_iterator | operator+(qsizetype j) const |
| const_iterator | operator-(qsizetype j) const |
| qsizetype | operator-(const const_iterator &j) const |
Detailed Description
Dereferencing it returns each element as a QVariant.
Differences from Qt
The iterator is addressed by index, so advancing an iterator over a std::list or a QSet takes time proportional to the position.
Member Type Documentation
typedef QSequentialIterable::const_iterator::difference_type
The type of the difference between two iterators.
typedef QSequentialIterable::const_iterator::iterator_category
The category of the iterator for the standard library.
typedef QSequentialIterable::const_iterator::pointer
The pointer type of the elements.
typedef QSequentialIterable::const_iterator::reference
The type that dereferencing the iterator returns: a QVariant by value.
typedef QSequentialIterable::const_iterator::value_type
The type of the elements: QVariant.
Member Function Documentation
QSequentialIterable::const_iterator::const_iterator()
Constructs an iterator that does not refer to a container.
bool QSequentialIterable::const_iterator::operator!=(const const_iterator &o) const
Returns true if o refers to a different position or container.
QVariant QSequentialIterable::const_iterator::operator*() const
Returns the element that the iterator refers to.
const_iterator QSequentialIterable::const_iterator::operator+(qsizetype j) const
Returns an iterator j elements after this one.
const_iterator & QSequentialIterable::const_iterator::operator++()
Advances the iterator by one element and returns a reference to it.
const_iterator QSequentialIterable::const_iterator::operator++(int)
This is an overloaded function.
Advances the iterator by one element and returns its previous position.
const_iterator & QSequentialIterable::const_iterator::operator+=(qsizetype j)
Advances the iterator by j elements and returns a reference to it.
const_iterator QSequentialIterable::const_iterator::operator-(qsizetype j) const
Returns an iterator j elements before this one.
qsizetype QSequentialIterable::const_iterator::operator-(const const_iterator &j) const
Returns the number of elements between j and this iterator.
const_iterator & QSequentialIterable::const_iterator::operator--()
Moves the iterator back by one element and returns a reference to it.
const_iterator QSequentialIterable::const_iterator::operator--(int)
This is an overloaded function.
Moves the iterator back by one element and returns its previous position.
const_iterator & QSequentialIterable::const_iterator::operator-=(qsizetype j)
Moves the iterator back by j elements and returns a reference to it.
bool QSequentialIterable::const_iterator::operator<(const const_iterator &o) const
Returns true if this iterator is before o.
bool QSequentialIterable::const_iterator::operator<=(const const_iterator &o) const
Returns true if this iterator is before or at the position of o.
bool QSequentialIterable::const_iterator::operator==(const const_iterator &o) const
Returns true if o refers to the same position in the same container.
bool QSequentialIterable::const_iterator::operator>(const const_iterator &o) const
Returns true if this iterator is after o.
bool QSequentialIterable::const_iterator::operator>=(const const_iterator &o) const
Returns true if this iterator is after or at the position of o.
QVariant QSequentialIterable::const_iterator::operator[](qsizetype j) const
Returns the element j positions after the one this iterator refers to.