QtBase
v6.3.1
|
The QAssociativeIterable class is an iterable interface for an associative container in a QVariant. More...
#include <qassociativeiterable.h>
Public Types | |
using | iterator = QTaggedIterator< QAssociativeIterator, void > |
using | const_iterator = QTaggedIterator< QAssociativeConstIterator, void > |
using | RandomAccessIterator = QTaggedIterator< iterator, std::random_access_iterator_tag > |
using | BidirectionalIterator = QTaggedIterator< iterator, std::bidirectional_iterator_tag > |
using | ForwardIterator = QTaggedIterator< iterator, std::forward_iterator_tag > |
using | InputIterator = QTaggedIterator< iterator, std::input_iterator_tag > |
using | RandomAccessConstIterator = QTaggedIterator< const_iterator, std::random_access_iterator_tag > |
using | BidirectionalConstIterator = QTaggedIterator< const_iterator, std::bidirectional_iterator_tag > |
using | ForwardConstIterator = QTaggedIterator< const_iterator, std::forward_iterator_tag > |
using | InputConstIterator = QTaggedIterator< const_iterator, std::input_iterator_tag > |
Additional Inherited Members | |
Protected Attributes inherited from QIterable< QMetaAssociation > | |
uint | m_revision |
QtPrivate::QConstPreservingPointer< void, quint16 > | m_iterable |
QMetaAssociation | m_metaContainer |
The QAssociativeIterable class 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 QAssociativeIterable 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.
The container itself is not copied before iterating over it.
Definition at line 86 of file qassociativeiterable.h.
Exposes a const_iterator using std::bidirectional_iterator_tag.
Definition at line 98 of file qassociativeiterable.h.
Exposes an iterator using std::bidirectional_iterator_tag.
Definition at line 93 of file qassociativeiterable.h.
Definition at line 90 of file qassociativeiterable.h.
Exposes a const_iterator using std::forward_iterator_tag.
Definition at line 99 of file qassociativeiterable.h.
Exposes an iterator using std::forward_iterator_tag.
Definition at line 94 of file qassociativeiterable.h.
Exposes a const_iterator using std::input_iterator_tag.
Definition at line 100 of file qassociativeiterable.h.
Exposes an iterator using std::input_iterator_tag.
Definition at line 95 of file qassociativeiterable.h.
Definition at line 89 of file qassociativeiterable.h.
Exposes a const_iterator using std::random_access_iterator_tag.
Definition at line 97 of file qassociativeiterable.h.
Exposes an iterator using std::random_access_iterator_tag.
Definition at line 92 of file qassociativeiterable.h.
Definition at line 103 of file qassociativeiterable.h.
|
inline |
Definition at line 109 of file qassociativeiterable.h.
|
inline |
Definition at line 114 of file qassociativeiterable.h.
|
inline |
Definition at line 120 of file qassociativeiterable.h.
|
inline |
Definition at line 126 of file qassociativeiterable.h.
|
inline |
Definition at line 133 of file qassociativeiterable.h.
|
inline |
Definition at line 139 of file qassociativeiterable.h.
|
inline |
|
inline |
|
inline |
Definition at line 151 of file qassociativeiterable.h.
|
inline |
Returns true
if the container has an entry with the given key, or false
otherwise. If the key isn't convertible to the expected type, false
is returned.
Definition at line 223 of file qassociativeiterable.cpp.
|
inline |
QAssociativeIterable::const_iterator QAssociativeIterable::find | ( | const QVariant & | key | ) | const |
Retrieves a const_iterator pointing to the element at the given key, or the end of the container if that key does not exist. If the key isn't convertible to the expected type, the end of the container is returned.
Definition at line 193 of file qassociativeiterable.cpp.
Inserts a new entry with the given key, or resets the mapped value of any existing entry with the given key to the default constructed mapped value. The key is coerced to the expected type: If it isn't convertible, a default value is inserted.
Definition at line 238 of file qassociativeiterable.cpp.
|
inline |
|
inline |
Definition at line 154 of file qassociativeiterable.h.
QAssociativeIterable::iterator QAssociativeIterable::mutableFind | ( | const QVariant & | key | ) |
Retrieves an iterator pointing to the element at the given key, or the end of the container if that key does not exist. If the key isn't convertible to the expected type, the end of the container is returned.
Definition at line 209 of file qassociativeiterable.cpp.
|
inline |
Removes the entry with the given key from the container. The key is coerced to the expected type: If it isn't convertible, the default value is removed.
Definition at line 250 of file qassociativeiterable.cpp.
Sets the mapped value associated with key to mapped, if possible. Inserts a new entry if none exists yet, for the given key. If the key is not convertible to the key type, the value for the default-constructed key type is overwritten.
Definition at line 289 of file qassociativeiterable.cpp.
Retrieves the mapped value at the given key, or a default-constructed QVariant of the mapped type, if the key does not exist. If the key is not convertible to the key type, the mapped value associated with the default-constructed key is returned.
Definition at line 264 of file qassociativeiterable.cpp.