![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits. More...
#include <qiterable.h>
Public Types | |
using | iterator_category = IteratorCategory |
Public Types inherited from Iterator<, int > | |
using | key_type |
Typedef for Key. | |
using | mapped_type |
Typedef for T. | |
using | value_type |
using | size_type |
Typedef for int. | |
using | difference_type |
Typedef for ptrdiff_t. | |
using | reference |
using | const_reference |
typedef QKeyValueIterator< const QAbstractAnimation *&, const int &, const_iterator > | const_key_value_iterator |
\inmodule QtCore | |
typedef QKeyValueIterator< const QAbstractAnimation *&, int &, iterator > | key_value_iterator |
\inmodule QtCore | |
typedef iterator | Iterator |
Qt-style synonym for QHash::iterator. | |
typedef const_iterator | ConstIterator |
Qt-style synonym for QHash::const_iterator. |
Public Member Functions | |
QTaggedIterator (Iterator &&it) | |
Constructs a QTaggedIterator from an iterator or QConstIterator it. | |
bool | operator== (const QTaggedIterator &o) const |
Returns true if other points to the same item as this iterator; otherwise returns false . | |
bool | operator!= (const QTaggedIterator &o) const |
Returns true if other points to a different item than this iterator; otherwise returns false . | |
QTaggedIterator & | operator++ () |
The prefix {++} operator ( {++it}) advances the iterator to the next item in the container and returns an iterator to the new current item. | |
QTaggedIterator | operator++ (int x) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator ( {it++}) advances the iterator to the next item in the container and returns an iterator to the previously current item. | |
QTaggedIterator & | operator-- () |
The prefix {–} operator ( {–it}) makes the preceding item current and returns an iterator to the new current item. | |
QTaggedIterator | operator-- (int x) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator ( {it–}) makes the preceding item current and returns an iterator to the previously current item. | |
QTaggedIterator & | operator+= (qsizetype j) |
Advances the iterator by j items. | |
QTaggedIterator & | operator-= (qsizetype j) |
Makes the iterator go back by j items. | |
QTaggedIterator | operator+ (qsizetype j) const |
Returns an iterator to the item at j positions forward from this iterator. | |
QTaggedIterator | operator- (qsizetype j) const |
Returns an iterator to the item at j positions backward from this iterator. | |
qsizetype | operator- (const QTaggedIterator &j) const |
bool | operator< (const QTaggedIterator &j) |
bool | operator>= (const QTaggedIterator &j) |
bool | operator> (const QTaggedIterator &j) |
bool | operator<= (const QTaggedIterator &j) |
Public Member Functions inherited from Iterator<, int > | |
QHash () noexcept=default | |
Constructs an empty hash. | |
QHash (std::initializer_list< std::pair< QAbstractAnimation *, int > > list) | |
QHash (const QHash &other) noexcept | |
Constructs a copy of other. | |
~QHash () | |
Destroys the hash. | |
QHash & | operator= (const QHash &other) noexcept(std::is_nothrow_destructible< Node >::value) |
Assigns other to this hash and returns a reference to this hash. | |
QHash (QHash &&other) noexcept | |
Move-constructs a QHash instance, making it point at the same object that other was pointing to. | |
QHash (InputIterator f, InputIterator l) | |
QHash (InputIterator f, InputIterator l) | |
void | swap (QHash &other) noexcept |
qsizetype | removeIf (Predicate pred) |
int | take (const QAbstractAnimation *&key) |
Removes the item with the key from the hash and returns the value associated with it. | |
bool | contains (const QAbstractAnimation *&key) const noexcept |
Returns true if the hash contains an item with the key; otherwise returns false . | |
qsizetype | count (const QAbstractAnimation *&key) const noexcept |
Returns the number of items associated with the key. | |
QAbstractAnimation * | key (const int &value) const noexcept |
QAbstractAnimation * | key (const int &value, const QAbstractAnimation *&defaultKey) const noexcept |
int | value (const QAbstractAnimation *&key) const noexcept |
int | value (const QAbstractAnimation *&key, const int &defaultValue) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the value associated with the key. | |
int & | operator[] (const QAbstractAnimation *&key) |
Returns the value associated with the key as a modifiable reference. | |
const int | operator[] (const QAbstractAnimation *&key) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as value(). | |
QList< QAbstractAnimation * > | keys () const |
Returns a list containing all the keys in the hash, in an arbitrary order. | |
QList< QAbstractAnimation * > | keys (const int &value) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a list containing all the keys associated with value value, in an arbitrary order. | |
QList< int > | values () const |
Returns a list containing all the values in the hash, in an arbitrary order. | |
iterator | begin () |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash. | |
const_iterator | begin () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | cbegin () const noexcept |
const_iterator | constBegin () const noexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash. | |
iterator | end () noexcept |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash. | |
const_iterator | end () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | cend () const noexcept |
const_iterator | constEnd () const noexcept |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last item in the hash. | |
key_iterator | keyBegin () const noexcept |
key_iterator | keyEnd () const noexcept |
key_value_iterator | keyValueBegin () |
key_value_iterator | keyValueEnd () |
const_key_value_iterator | keyValueBegin () const noexcept |
const_key_value_iterator | constKeyValueBegin () const noexcept |
const_key_value_iterator | keyValueEnd () const noexcept |
const_key_value_iterator | constKeyValueEnd () const noexcept |
auto | asKeyValueRange () & |
auto | asKeyValueRange () const & |
auto | asKeyValueRange () && |
auto | asKeyValueRange () const && |
iterator | erase (const_iterator it) |
std::pair< iterator, iterator > | equal_range (const QAbstractAnimation *&key) |
std::pair< const_iterator, const_iterator > | equal_range (const QAbstractAnimation *&key) const noexcept |
qsizetype | count () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as size(). | |
iterator | find (const QAbstractAnimation *&key) |
Returns an iterator pointing to the item with the key in the hash. | |
const_iterator | find (const QAbstractAnimation *&key) const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const_iterator | constFind (const QAbstractAnimation *&key) const noexcept |
iterator | insert (const QAbstractAnimation *&key, const int &value) |
Inserts a new item with the key and a value of value. | |
void | insert (const QHash &hash) |
iterator | emplace (const QAbstractAnimation *&key, Args &&... args) |
iterator | emplace (QAbstractAnimation *&&key, Args &&... args) |
Inserts a new element into the container. | |
TryEmplaceResult | tryEmplace (const QAbstractAnimation *&key, Args &&...args) |
\variable QHash::TryEmplaceResult::iterator | |
TryEmplaceResult | tryEmplace (QAbstractAnimation *&&key, Args &&...args) |
TryEmplaceResult | tryInsert (const QAbstractAnimation *&key, const int &value) |
std::pair< key_value_iterator, bool > | try_emplace (const QAbstractAnimation *&key, Args &&...args) |
std::pair< key_value_iterator, bool > | try_emplace (QAbstractAnimation *&&key, Args &&...args) |
key_value_iterator | try_emplace (const_iterator, const QAbstractAnimation *&key, Args &&...args) |
key_value_iterator | try_emplace (const_iterator, QAbstractAnimation *&&key, Args &&...args) |
TryEmplaceResult | insertOrAssign (const QAbstractAnimation *&key, Value &&value) |
TryEmplaceResult | insertOrAssign (QAbstractAnimation *&&key, Value &&value) |
std::pair< key_value_iterator, bool > | insert_or_assign (const QAbstractAnimation *&key, Value &&value) |
std::pair< key_value_iterator, bool > | insert_or_assign (QAbstractAnimation *&&key, Value &&value) |
key_value_iterator | insert_or_assign (const_iterator, const QAbstractAnimation *&key, Value &&value) |
key_value_iterator | insert_or_assign (const_iterator, QAbstractAnimation *&&key, Value &&value) |
float | load_factor () const noexcept |
Returns the current load factor of the QHash's internal hash table. | |
size_t | bucket_count () const noexcept |
bool | empty () const noexcept |
This function is provided for STL compatibility. | |
bool | remove (const K &key) |
int | take (const K &key) |
bool | contains (const K &key) const |
qsizetype | count (const K &key) const |
int | value (const K &key) const noexcept |
int | value (const K &key, const int &defaultValue) const noexcept |
int & | operator[] (const K &key) |
const int | operator[] (const K &key) const noexcept |
std::pair< iterator, iterator > | equal_range (const K &key) |
std::pair< const_iterator, const_iterator > | equal_range (const K &key) const noexcept |
iterator | find (const K &key) |
const_iterator | find (const K &key) const noexcept |
const_iterator | constFind (const K &key) const noexcept |
TryEmplaceResult | tryEmplace (K &&key, Args &&...args) |
TryEmplaceResult | tryInsert (K &&key, const int &value) |
std::pair< key_value_iterator, bool > | try_emplace (K &&key, Args &&...args) |
key_value_iterator | try_emplace (const_iterator, K &&key, Args &&...args) |
TryEmplaceResult | insertOrAssign (K &&key, Value &&value) |
std::pair< key_value_iterator, bool > | insert_or_assign (K &&key, Value &&value) |
key_value_iterator | insert_or_assign (const_iterator, K &&key, Value &&value) |
Friends | |
QTaggedIterator | operator+ (qsizetype j, const QTaggedIterator &k) |
Returns an iterator to the item at j positions forward from iterator k. |
Additional Inherited Members | |
Static Public Member Functions inherited from Iterator<, int > | |
static float | max_load_factor () noexcept |
static size_t | max_bucket_count () noexcept |
Related Symbols inherited from Iterator<, int > | |
template< typename... int > size_t | qHashMulti (size_t seed, const int &...args) |
template< typename... int > size_t | qHashMultiCommutative (size_t seed, const int &...args) |
template< typename InputIterator > size_t | qHashRange (InputIterator first, InputIterator last, size_t seed=0) |
template< typename InputIterator > size_t | qHashRangeCommutative (InputIterator first, InputIterator last, size_t seed=0) |
size_t | qHashBits (const void *p, size_t len, size_t seed=0) |
template< typename int > bool | qHashEquals (const int &a, const int &b) |
template< class QAbstractAnimation *, class int > QDataStream & | operator<< (QDataStream &out, const QHash< QAbstractAnimation *, int > &hash) |
Writes the hash hash to stream out. | |
template< class QAbstractAnimation *, class int > QDataStream & | operator>> (QDataStream &in, QHash< QAbstractAnimation *, int > &hash) |
Reads a hash from stream in into hash. | |
template< typename QAbstractAnimation *, typename int, typename Predicate > qsizetype | erase_if (QHash< QAbstractAnimation *, int > &hash, Predicate pred) |
size_t | qHash (const QGeoCoordinate &coordinate, size_t seed=0) |
Returns a hash value for coordinate, using seed to seed the calculation. |
QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits.
In order to use an iterator any of the standard algorithms, its iterator traits need to be known. As QSequentialIterable can work with many different kinds of containers, we cannot declare the traits in the iterator classes themselves. A QTaggedIterator gives you a way to explicitly declare a trait for a concrete instance of an iterator or QConstIterator.
Definition at line 70 of file qiterable.h.
using QTaggedIterator< Iterator, IteratorCategory >::iterator_category = IteratorCategory |
Definition at line 73 of file qiterable.h.
|
inline |
Constructs a QTaggedIterator from an iterator or QConstIterator it.
Checks whether the IteratorCategory passed as template argument matches the run time capabilities of it; if there's no match, it is refused.
Definition at line 74 of file qiterable.h.
Referenced by QTaggedIterator< QAssociativeIterator, void >::QTaggedIterator().
|
inline |
Returns true
if other points to a different item than this iterator; otherwise returns false
.
Definition at line 109 of file qiterable.h.
|
inline |
Returns an iterator to the item at j positions forward from this iterator.
Definition at line 116 of file qiterable.h.
|
inline |
The prefix {++} operator (
{++it}) advances the iterator to the next item in the container and returns an iterator to the new current item.
Calling this function on QSequentialIterable::constEnd() leads to undefined results.
Definition at line 110 of file qiterable.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator (
{it++}) advances the iterator to the next item in the container and returns an iterator to the previously current item.
Definition at line 111 of file qiterable.h.
|
inline |
Advances the iterator by j items.
Definition at line 114 of file qiterable.h.
|
inline |
Definition at line 118 of file qiterable.h.
|
inline |
Returns an iterator to the item at j positions backward from this iterator.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 117 of file qiterable.h.
|
inline |
The prefix {–} operator (
{–it}) makes the preceding item current and returns an iterator to the new current item.
Calling this function on QSequentialIterable::constBegin() leads to undefined results.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 112 of file qiterable.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator (
{it–}) makes the preceding item current and returns an iterator to the previously current item.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 113 of file qiterable.h.
|
inline |
Makes the iterator go back by j items.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 115 of file qiterable.h.
|
inline |
Definition at line 120 of file qiterable.h.
Referenced by QTaggedIterator< QAssociativeIterator, void >::operator>=().
|
inline |
Definition at line 123 of file qiterable.h.
|
inline |
Returns true
if other points to the same item as this iterator; otherwise returns false
.
Definition at line 108 of file qiterable.h.
|
inline |
Definition at line 122 of file qiterable.h.
Referenced by QTaggedIterator< QAssociativeIterator, void >::operator<=().
|
inline |
Definition at line 121 of file qiterable.h.
|
friend |
Returns an iterator to the item at j positions forward from iterator k.
Definition at line 125 of file qiterable.h.