QIterator 結構

template <typename Container> struct QIterator

QIterator 是允許迭代容器的模闆類,在 QVariant . 更多...

頭: #include <QIterator>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0
繼承: QBaseIterator

公共函數

QIterator (QIterable<Container> * iterable , void * iterator )
bool operator!= (const QIterator<Container> & other ) const
QIterator<Container> operator+ (qsizetype j ) const
QIterator<Container> & operator++ ()
QIterator<Container> operator++ (int)
QIterator<Container> & operator+= (qsizetype j )
QIterator<Container> operator- (qsizetype j ) const
qsizetype operator- (const QIterator<Container> & j ) const
QIterator<Container> & operator-- ()
QIterator<Container> operator-- (int)
QIterator<Container> & operator-= (qsizetype j )
bool operator== (const QIterator<Container> & other ) const
QIterator<Container> operator+ (qsizetype j , const QIterator<Container> & k )

詳細描述

A QIterator can only be created by a QIterable instance, and can be used in a way similar to other stl-style iterators. Generally, QIterator should not be used directly, but through its derived classes provided by QSequentialIterable and QAssociativeIterable .

另請參閱 QIterable .

成員函數文檔編製

[explicit] QIterator:: QIterator ( QIterable < 容器 > * iterable , void * iterator )

Creates an iterator from an iterable and a pointer to a native iterator .

bool QIterator:: operator!= (const QIterator < 容器 > & other ) const

返迴 true if other 指嚮與此迭代器不同的項;否則返迴 false .

另請參閱 operator== ().

QIterator < 容器 > QIterator:: operator+ ( qsizetype j ) const

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

另請參閱 operator- () 和 operator+= ().

QIterator < 容器 > &QIterator:: 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.

另請參閱 operator-- ().

QIterator < 容器 > QIterator:: operator++ ( int )

這是重載函數。

The postfix ++ 運算符 ( it++ ) advances the iterator to the next item in the container and returns an iterator to the previously current item.

QIterator < 容器 > &QIterator:: operator+= ( qsizetype j )

推進迭代器 j 項。

另請參閱 operator-= () 和 operator+ ().

QIterator < 容器 > QIterator:: operator- ( qsizetype j ) const

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.

另請參閱 operator+ (), operator-= (),和 QIterable::canReverseIterate ().

qsizetype QIterator:: operator- (const QIterator < 容器 > & j ) const

這是重載函數。

Returns the distance between the two iterators.

另請參閱 operator+ (), operator-= (),和 QIterable::canReverseIterate ().

QIterator < 容器 > &QIterator:: 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.

另請參閱 operator++ () 和 QIterable::canReverseIterate ().

QIterator < 容器 > QIterator:: operator-- ( int )

這是重載函數。

The postfix -- 運算符 ( 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.

另請參閱 QIterable::canReverseIterate ().

QIterator < 容器 > &QIterator:: operator-= ( qsizetype j )

Makes the iterator go back by j 項。

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

另請參閱 operator+= (), operator- (),和 QIterable::canReverseIterate ().

bool QIterator:: operator== (const QIterator < 容器 > & other ) const

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

另請參閱 operator!= ().

相關非成員

QIterator < 容器 > operator+ ( qsizetype j , const QIterator < 容器 > & k )

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