Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QConstIterator< Container > Struct Template Reference

The QConstIterator allows iteration over a container in a QVariant. More...

#include <qiterable.h>

+ Inheritance diagram for QConstIterator< Container >:
+ Collaboration diagram for QConstIterator< Container >:

Public Types

using difference_type = qsizetype
 

Public Member Functions

 QConstIterator (const QIterable< Container > *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
 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
 

Friends

QConstIterator operator+ (qsizetype j, const QConstIterator &k)
 

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

template<class Container>
struct QConstIterator< Container >

The QConstIterator allows iteration over a container in a QVariant.

Since
6.0 \inmodule QtCore
See also
QIterator, QIterable

Definition at line 308 of file qiterable.h.

Member Typedef Documentation

◆ difference_type

template<class Container >
using QConstIterator< Container >::difference_type = qsizetype

Definition at line 311 of file qiterable.h.

Constructor & Destructor Documentation

◆ QConstIterator()

template<class Container >
template< class Container > QConstIterator< Container >::QConstIterator ( const QIterable< Container > *  iterable,
void iterator 
)
inlineexplicit

Creates a QConstIterator to wrap iterator, operating on iterable.

Definition at line 313 of file qiterable.h.

Member Function Documentation

◆ operator!=()

template<class Container >
template< class Container > bool QConstIterator< Container >::operator!= ( const QConstIterator< Container > &  o) const
inline

Returns true if other points to a different item than this iterator; otherwise returns false.

See also
operator==()

Definition at line 324 of file qiterable.h.

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

+ Here is the call graph for this function:

◆ operator+()

template<class Container >
template< class Container > QConstIterator< Container > QConstIterator< Container >::operator+ ( qsizetype  j) const
inline

Returns an iterator to the item at j positions forward from this iterator.

See also
operator-(), operator+=()

Definition at line 374 of file qiterable.h.

References QBaseIterator< Container >::constIterable(), j, QBaseIterator< Container >::metaContainer(), and this.

+ Here is the call graph for this function:

◆ operator++() [1/2]

template<class Container >
template< class Container > QConstIterator< Container > & QConstIterator< Container >::operator++ ( )
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 QIterable<Container>::end() leads to undefined results.

See also
operator--()

Definition at line 330 of file qiterable.h.

References QBaseIterator< Container >::metaContainer(), and QBaseIterator< Container >::mutableIterator().

+ Here is the call graph for this function:

◆ operator++() [2/2]

template<class Container >
template< class Container > QConstIterator< Container > QConstIterator< Container >::operator++ ( int  )
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 336 of file qiterable.h.

References QBaseIterator< Container >::constIterable(), QBaseIterator< Container >::metaContainer(), QBaseIterator< Container >::mutableIterator(), and this.

+ Here is the call graph for this function:

◆ operator+=()

template<class Container >
template< class Container > QConstIterator< Container > & QConstIterator< Container >::operator+= ( qsizetype  j)
inline

Advances the iterator by j items.

See also
operator-=(), operator+()

Definition at line 362 of file qiterable.h.

References QBaseIterator< Container >::metaContainer(), and QBaseIterator< Container >::mutableIterator().

+ Here is the call graph for this function:

◆ operator-() [1/2]

template<class Container >
template< class Container > qsizetype QConstIterator< Container >::operator- ( const QConstIterator< Container > &  j) const
inline

Returns the distance between the two iterators.

See also
operator+(), operator-=(), QIterable::canReverseIterate()

Definition at line 395 of file qiterable.h.

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

+ Here is the call graph for this function:

◆ operator-() [2/2]

template<class Container >
template< class Container > QConstIterator< Container > QConstIterator< Container >::operator- ( qsizetype  j) const
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.

See also
operator+(), operator-=(), QIterable::canReverseIterate()

Definition at line 385 of file qiterable.h.

References QBaseIterator< Container >::constIterable(), j, QBaseIterator< Container >::metaContainer(), and this.

+ Here is the call graph for this function:

◆ operator--() [1/2]

template<class Container >
template< class Container > QConstIterator< Container > & QConstIterator< Container >::operator-- ( )
inline

The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item.

Calling this function on QIterable<Container>::begin() leads to undefined results.

If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.

See also
operator++(), QIterable::canReverseIterate()

Definition at line 346 of file qiterable.h.

References QBaseIterator< Container >::metaContainer(), and QBaseIterator< Container >::mutableIterator().

+ Here is the call graph for this function:

◆ operator--() [2/2]

template<class Container >
template< class Container > QConstIterator< Container > QConstIterator< Container >::operator-- ( int  )
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.

See also
QIterable::canReverseIterate()

Definition at line 352 of file qiterable.h.

References QBaseIterator< Container >::constIterable(), QBaseIterator< Container >::metaContainer(), QBaseIterator< Container >::mutableIterator(), and this.

+ Here is the call graph for this function:

◆ operator-=()

template<class Container >
template< class Container > QConstIterator< Container > & QConstIterator< Container >::operator-= ( qsizetype  j)
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.

See also
operator+=(), operator-(), QIterable::canReverseIterate()

Definition at line 368 of file qiterable.h.

References QBaseIterator< Container >::metaContainer(), and QBaseIterator< Container >::mutableIterator().

+ Here is the call graph for this function:

◆ operator==()

template<class Container >
template< class Container > bool QConstIterator< Container >::operator== ( const QConstIterator< Container > &  o) const
inline

Returns true if other points to the same item as this iterator; otherwise returns false.

See also
operator!=()

Definition at line 318 of file qiterable.h.

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

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator+

template<class Container >
QConstIterator operator+ ( qsizetype  j,
const QConstIterator< Container > &  k 
)
friend

Definition at line 400 of file qiterable.h.


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