QIterator Struct
template <typename Container> struct QIteratorQIterator는 QVariant...에서 컨테이너에 대한 반복을 허용하는 템플릿 클래스입니다... .
헤더: | #include <QIterator> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
이후: | 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) |
상세 설명
QIterator는 QIterable 인스턴스에 의해서만 생성될 수 있으며, 다른 stl 스타일 이터레이터와 유사한 방식으로 사용할 수 있습니다. 일반적으로 QIterator는 직접 사용해서는 안 되며 QSequentialIterable 및 QAssociativeIterable 에서 제공하는 파생 클래스를 통해 사용해야 합니다.
QIterable도 참조하십시오 .
멤버 함수 문서
[explicit]
QIterator::QIterator(QIterable<Container> *iterable, void *iterator)
iterable 에서 이터레이터와 네이티브 iterator 에 대한 포인터를 생성합니다.
bool QIterator::operator!=(const QIterator<Container> &other) const
other 이 이터레이터와 다른 항목을 가리키면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
operator==()도 참조하세요 .
QIterator<Container> QIterator::operator+(qsizetype j) const
이 반복자에서 앞으로 j 위치에 있는 항목에 대한 반복자를 반환합니다.
operator-() 및 operator+=()도 참조하세요 .
QIterator<Container> &QIterator::operator++()
접두사 ++
연산자(++it
)는 이터레이터를 컨테이너의 다음 항목으로 전진시키고 새로운 현재 항목으로 이터레이터를 반환합니다.
이 함수를 QSequentialIterable::end()에서 호출하면 정의되지 않은 결과가 발생합니다.
operator--()도 참조하세요 .
QIterator<Container> QIterator::operator++(int)
이 함수는 오버로드된 함수입니다.
후위 ++
연산자(it++
)는 컨테이너의 다음 항목으로 반복기를 전진시키고 이전 현재 항목으로 반복기를 반환합니다.
QIterator<Container> &QIterator::operator+=(qsizetype j)
반복기를 j 항목만큼 전진시킵니다.
operator-=() 및 operator+()도 참조하세요 .
QIterator<Container> QIterator::operator-(qsizetype j) const
이 이터레이터에서 역방향으로 j 위치에 있는 항목에 대한 이터레이터를 반환합니다.
QVariant 의 컨테이너가 양방향 반복을 지원하지 않는 경우 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
operator+(), operator-=() 및 QIterable::canReverseIterate()도 참조하세요 .
qsizetype QIterator::operator-(const QIterator<Container> &j) const
이 함수는 오버로드된 함수입니다.
두 이터레이터 사이의 거리를 반환합니다.
operator+(), operator-=() 및 QIterable::canReverseIterate()도 참조하세요 .
QIterator<Container> &QIterator::operator--()
접두사 --
연산자(--it
)는 앞의 항목을 현재 항목으로 만들고 새로운 현재 항목에 대한 이터레이터를 반환합니다.
QSequentialIterable::begin()에서 이 함수를 호출하면 정의되지 않은 결과가 나타납니다.
QVariant 의 컨테이너가 양방향 반복을 지원하지 않는 경우 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
operator++() 및 QIterable::canReverseIterate()도 참조하세요 .
QIterator<Container> QIterator::operator--(int)
이 함수는 오버로드된 함수입니다.
후위 --
연산자(it--
)는 이전 항목을 현재 항목으로 만들고 이전 항목에 대한 반복자를 반환합니다.
QVariant 의 컨테이너가 양방향 반복을 지원하지 않는 경우 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
QIterable::canReverseIterate()도 참조하세요 .
QIterator<Container> &QIterator::operator-=(qsizetype j)
반복기를 j 항목별로 거슬러 올라갑니다.
QVariant 의 컨테이너가 양방향 반복을 지원하지 않는 경우 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
operator+=(), operator-() 및 QIterable::canReverseIterate()도 참조하세요 .
bool QIterator::operator==(const QIterator<Container> &other) const
other 이 이터레이터와 동일한 항목을 가리키면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
operator!=()도 참조하세요 .
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.