QKeyValueIterator Class

Iterator over the key/value pairs of an associative container. More...

Header: #include <QKeyValueIterator>
qmake: QT += core
Since: Qt 5.10

Public Functions

QKeyValueIterator()
QKeyValueIterator(Iterator o)
Iterator base() const
std::pair<Key, T> operator*() const
QKeyValueIterator<Key, T, Iterator> &operator++()
QKeyValueIterator<Key, T, Iterator> operator++(int)
QKeyValueIterator<Key, T, Iterator> &operator--()
QKeyValueIterator<Key, T, Iterator> operator--(int)

Detailed Description

Iterator over the key/value pairs of an associative container.

The QKeyValueIterator class provides an STL-style iterator for returning key/value pairs from associative containers like QHash and QMap. It supports the same API as the STL associative containers, i.e. getting a key/value pair when iterating through the container.

This will allow for better interoperability between QMap, QHash and friends and STL-style algorithms.

Warning: Iterators on implicitly shared containers do not work exactly like STL-iterators. You should avoid copying a container while iterators are active on that container. For more information, read Implicit sharing iterator problem.

Member Function Documentation

QKeyValueIterator::QKeyValueIterator()

Default constructs an instance of QKeyValueIterator.

QKeyValueIterator::QKeyValueIterator(Iterator o)

Default constructs an instance of QKeyValueIterator.

Iterator QKeyValueIterator::base() const

std::pair<Key, T> QKeyValueIterator::operator*() const

QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator++()

QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator++(int)

QKeyValueIterator<Key, T, Iterator> &QKeyValueIterator::operator--()

QKeyValueIterator<Key, T, Iterator> QKeyValueIterator::operator--(int)