Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Iterable Class Reference

\inherits QIterable More...

Collaboration diagram for Iterable:

Detailed Description

\inherits QIterable

Since
6.11 \inmodule QtCore

QMetaAssociation::Iterable is an iterable interface for an associative container in a QVariant.

This class allows several methods of accessing the elements of an associative container held within a QVariant. An instance of QMetaAssociation::Iterable can be extracted from a QVariant if it can be converted to a QVariantHash or QVariantMap or if a custom mutable view has been registered.

mapping.insert(7, "Seven");
mapping.insert(11, "Eleven");
mapping.insert(42, "Forty-two");
// Can use C++11 range-for over the values:
for (const QVariant &v : iterable) {
qDebug() << v;
}
// Can use iterators:
for ( ; it != end; ++it) {
qDebug() << *it; // The current value
qDebug() << it.key();
qDebug() << it.value();
}
}

The container itself is not copied before iterating over it.

See also
QVariant

The documentation for this class was generated from the following file: