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
QAssociativeIterator Class Reference

#include <qassociativeiterable.h>

Inheritance diagram for QAssociativeIterator:
Collaboration diagram for QAssociativeIterator:

Public Types

using key_type = QVariant
using mapped_type = QVariant
using reference = QVariantRef<QAssociativeIterator>
using pointer = QVariantPointer<QAssociativeIterator>
Public Types inherited from QIterator< QMetaAssociation >
using difference_type

Public Member Functions

 QAssociativeIterator (QIterator &&it)
QVariant key () const
 Returns the key this iterator points to.
QVariantRef< QAssociativeIteratorvalue () const
 Returns the mapped value this iterator points to.
QVariantRef< QAssociativeIteratoroperator* () const
 Returns the current item, converted to a QVariantRef.
QVariantPointer< QAssociativeIteratoroperator-> () const
 Returns the current item, converted to a QVariantPointer.
Public Member Functions inherited from QIterator< QMetaAssociation >
 QIterator (QIterable< QMetaAssociation > *iterable, void *iterator)
 Creates an iterator from an iterable and a pointer to a native iterator.
bool operator== (const QIterator &o) const
 Returns true if other points to the same item as this iterator; otherwise returns false.
bool operator!= (const QIterator &o) const
 Returns true if other points to a different item than this iterator; otherwise returns false.
QIteratoroperator++ ()
 The prefix {++} operator ({++it}) advances the iterator to the next item in the container and returns an iterator to the new current item.
QIteratoroperator-- ()
 The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item.
QIteratoroperator+= (qsizetype j)
 Advances the iterator by j items.
QIteratoroperator-= (qsizetype j)
 Makes the iterator go back by j items.
QIterator operator+ (qsizetype j) const
 Returns an iterator to the item at j positions forward from this iterator.
QIterator operator- (qsizetype j) const
 Returns an iterator to the item at j positions backward from this iterator.
Public Member Functions inherited from QBaseIterator< QMetaAssociation >
voidmutableIterator ()
 Returns a non-const pointer to the internal native iterator.
const voidconstIterator () const
 Returns a const pointer to the internal native iterator.
QMetaAssociation metaContainer () const

Additional Inherited Members

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

Detailed Description

Definition at line 12 of file qassociativeiterable.h.

Member Typedef Documentation

◆ key_type

◆ mapped_type

◆ pointer

◆ reference

Constructor & Destructor Documentation

◆ QAssociativeIterator()

QAssociativeIterator::QAssociativeIterator ( QIterator && it)
inline

Definition at line 20 of file qassociativeiterable.h.

Member Function Documentation

◆ key()

QT_BEGIN_NAMESPACE QVariant QAssociativeIterator::key ( ) const

Returns the key this iterator points to.

Definition at line 13 of file qassociativeiterable.cpp.

◆ operator*()

QVariantRef< QAssociativeIterator > QAssociativeIterator::operator* ( ) const

Returns the current item, converted to a QVariantRef.

The resulting QVariantRef resolves to the mapped value if there is one, or to the key value if not.

Definition at line 36 of file qassociativeiterable.cpp.

◆ operator->()

QVariantPointer< QAssociativeIterator > QAssociativeIterator::operator-> ( ) const

Returns the current item, converted to a QVariantPointer.

The resulting QVariantPointer resolves to the mapped value if there is one, or to the key value if not.

Definition at line 46 of file qassociativeiterable.cpp.

◆ value()

QVariantRef< QAssociativeIterator > QAssociativeIterator::value ( ) const

Returns the mapped value this iterator points to.

If the container does not provide a mapped value (for example a set), returns an invalid QVariantRef.

Definition at line 25 of file qassociativeiterable.cpp.


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