6.0.0-rc4Source

QAssociativeIterable::const_iterator Class

The const_iterator class is a read-only iterator over a QAssociativeIterable. More…

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

List of all members, including inherited members

Public Types

typedefiterator_category
typedefdifference_type
typedefvalue_type
typedefpointer
typedefreference

Public Functions

const_iterator()
QVariantkey() const
QVariantvalue() const
QVariantoperator*() const
booloperator==(const const_iterator &o) const
booloperator!=(const const_iterator &o) const
const_iterator &operator++()
const_iteratoroperator++(int)
const_iterator &operator--()
const_iteratoroperator--(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().