Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAssociativeConstIterator Class Reference

#include <qassociativeiterable.h>

+ Inheritance diagram for QAssociativeConstIterator:
+ Collaboration diagram for QAssociativeConstIterator:

Public Types

using key_type = QVariant
 
using mapped_type = QVariant
 
using reference = const QVariant &
 
using pointer = QVariantConstPointer
 
- Public Types inherited from QConstIterator< QMetaAssociation >
using difference_type
 

Public Member Functions

 QAssociativeConstIterator (QConstIterator &&it)
 
QVariant key () const
 Returns the key this iterator points to.
 
QVariant value () const
 Returns the mapped value this iterator points to, or an invalid QVariant if there is no mapped value.
 
QVariant operator* () const
 Returns the current item, converted to a QVariant.
 
QVariantConstPointer operator-> () const
 Returns the current item, converted to a QVariantConstPointer.
 
- Public Member Functions inherited from QConstIterator< QMetaAssociation >
 QConstIterator (const QIterable< QMetaAssociation > *iterable, void *iterator)
 Creates a QConstIterator to wrap iterator, operating on iterable.
 
bool operator== (const QConstIterator &o) const
 Returns true if other points to the same item as this iterator; otherwise returns false.
 
bool operator!= (const QConstIterator &o) const
 Returns true if other points to a different item than this iterator; otherwise returns false.
 
QConstIteratoroperator++ ()
 The prefix {++} operator ({++it}) advances the iterator to the next item in the container and returns an iterator to the new current item.
 
QConstIterator operator++ (int)
 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.
 
QConstIteratoroperator-- ()
 The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item.
 
QConstIterator operator-- (int)
 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.
 
QConstIteratoroperator+= (qsizetype j)
 Advances the iterator by j items.
 
QConstIteratoroperator-= (qsizetype j)
 Makes the iterator go back by j items.
 
QConstIterator operator+ (qsizetype j) const
 Returns an iterator to the item at j positions forward from this iterator.
 
QConstIterator operator- (qsizetype j) const
 Returns an iterator to the item at j positions backward from this iterator.
 
qsizetype operator- (const QConstIterator &j) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the distance between the two iterators.
 
- Public Member Functions inherited from QBaseIterator< Container >
voidmutableIterator ()
 Returns a non-const pointer to the internal native iterator.
 
const voidconstIterator () const
 Returns a const pointer to the internal native iterator.
 
Container metaContainer () const
 

Additional Inherited Members

- Protected Member Functions inherited from QBaseIterator< Container >
 QBaseIterator ()=default
 
 QBaseIterator (const QIterable< Container > *iterable, void *iterator)
 
 QBaseIterator (QIterable< Container > *iterable, void *iterator)
 
 QBaseIterator (QBaseIterator &&other)
 
 QBaseIterator (const QBaseIterator &other)
 
 ~QBaseIterator ()
 
QBaseIteratoroperator= (QBaseIterator &&other)
 
QBaseIteratoroperator= (const QBaseIterator &other)
 
QIterable< Container > * mutableIterable () const
 
const QIterable< Container > * constIterable () const
 
void initIterator (const void *copy)
 
void clearIterator ()
 

Detailed Description

Definition at line 31 of file qassociativeiterable.h.

Member Typedef Documentation

◆ key_type

◆ mapped_type

◆ pointer

◆ reference

Definition at line 36 of file qassociativeiterable.h.

Constructor & Destructor Documentation

◆ QAssociativeConstIterator()

QAssociativeConstIterator::QAssociativeConstIterator ( QConstIterator && it)
inline

Definition at line 39 of file qassociativeiterable.h.

Member Function Documentation

◆ key()

QVariant QAssociativeConstIterator::key ( ) const

Returns the key this iterator points to.

Definition at line 55 of file qassociativeiterable.cpp.

References QBaseIterator< Container >::constIterator(), QBaseIterator< Container >::metaContainer(), and QIterablePrivate::retrieveElement().

Referenced by operator*().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*()

QVariant QAssociativeConstIterator::operator* ( ) const

Returns the current item, converted to a QVariant.

The returned value is the mapped value at the current iterator if there is one, or otherwise the key.

Definition at line 79 of file qassociativeiterable.cpp.

References QMetaType::isValid(), key(), QBaseIterator< Container >::metaContainer(), and value().

+ Here is the call graph for this function:

◆ operator->()

QVariantConstPointer QAssociativeConstIterator::operator-> ( ) const

Returns the current item, converted to a QVariantConstPointer.

The QVariantConstPointer will resolve to the mapped value at the current iterator if there is one, or otherwise the key.

Definition at line 90 of file qassociativeiterable.cpp.

◆ value()

QVariant QAssociativeConstIterator::value ( ) const

Returns the mapped value this iterator points to, or an invalid QVariant if there is no mapped value.

Definition at line 67 of file qassociativeiterable.cpp.

References QBaseIterator< Container >::constIterator(), QBaseIterator< Container >::metaContainer(), and QIterablePrivate::retrieveElement().

Referenced by operator*().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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