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

#include <qsequentialiterable.h>

+ Inheritance diagram for QSequentialIterator:
+ Collaboration diagram for QSequentialIterator:

Public Types

using value_type = QVariant
 
using reference = QVariantRef<QSequentialIterator>
 
using pointer = QVariantPointer<QSequentialIterator>
 
- Public Types inherited from QIterator< QMetaSequence >
using difference_type
 

Public Member Functions

 QSequentialIterator (QIterator &&it)
 
QVariantRef< QSequentialIteratoroperator* () const
 \typealias QSequentialIterable::const_iterator
 
QVariantPointer< QSequentialIteratoroperator-> () const
 Returns the current item, converted to a QVariantPointer.
 
- Public Member Functions inherited from QIterator< QMetaSequence >
 QIterator (QIterable< QMetaSequence > *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.
 
QIterator 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.
 
QIteratoroperator-- ()
 The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item.
 
QIterator 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.
 
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.
 
qsizetype operator- (const QIterator &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 12 of file qsequentialiterable.h.

Member Typedef Documentation

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ QSequentialIterator()

QSequentialIterator::QSequentialIterator ( QIterator && it)
inline

Definition at line 19 of file qsequentialiterable.h.

Member Function Documentation

◆ operator*()

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

\typealias QSequentialIterable::const_iterator

The QSequentialIterable::const_iterator allows iteration over a container in a QVariant.

A QSequentialIterable::const_iterator can only be created by a QSequentialIterable instance, and can be used in a way similar to other stl-style iterators.

QList<int> intList = {7, 11, 42};
// Can use foreach:
foreach (const QVariant &v, iterable) {
qDebug() << v;
}
// Can use C++11 range-for:
for (const QVariant &v : iterable) {
qDebug() << v;
}
// Can use iterators:
const QSequentialIterable::const_iterator end = iterable.end();
for ( ; it != end; ++it) {
qDebug() << *it;
}
}

\typealias QSequentialIterable::iterator

Since
6.0

The QSequentialIterable::iterator allows iteration over a container in a QVariant.

A QSequentialIterable::iterator can only be created by a QSequentialIterable instance, and can be used in a way similar to other stl-style iterators.

Returns the current item, converted to a QVariantRef.

Definition at line 184 of file qsequentialiterable.cpp.

◆ operator->()

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

Returns the current item, converted to a QVariantPointer.

Definition at line 192 of file qsequentialiterable.cpp.


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