The QIterator is a template class that allows iteration over a container in a 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
<
Container
> *
iterable
,
void
*
iterator
)
Creates an iterator from an iterable and a pointer to a native iterator .
返迴
true
if
other
指嚮與此迭代器不同的項;否則返迴
false
.
另請參閱 operator== ().
Returns an iterator to the item at j positions forward from this iterator.
另請參閱 operator- () 和 operator+= ().
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 QSequentialIterable::end() leads to undefined results.
另請參閱 operator-- ().
這是重載函數。
The postfix
++
operator (
it++
) advances the iterator to the next item in the container and returns an iterator to the previously current item.
推進迭代器 j 項。
另請參閱 operator-= () 和 operator+ ().
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 ().
Returns the distance between the two iterators.
另請參閱 operator+ (), operator-= (),和 QIterable::canReverseIterate ().
The prefix
--
operator (
--it
) makes the preceding item current and returns an iterator to the new current item.
Calling this function on QSequentialIterable::begin() 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 ().
這是重載函數。
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.
另請參閱 QIterable::canReverseIterate ().
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 ().
返迴
true
if
other
points to the same item as this iterator; otherwise returns
false
.
另請參閱 operator!= ().
Returns an iterator to the item at j positions forward from iterator k .