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 |
| 상속받은 버전: | QMetaAssociation::Iterable::Iterator 그리고 QMetaSequence::Iterable::Iterator |
공개 함수
| 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<Container>는 컨테이너에 대한 변경 가능한 반복 기능을 제공하며, 여기서 Container 는 컨테이너의 반복 기능을 정의하는 메타타입 설명자( QMetaSequence 또는 QMetaAssociation)입니다.
QIterator는 QIterable 인스턴스에 의해서만 생성될 수 있으며, 다른 STL 스타일의 반복자와 유사한 방식으로 사용할 수 있습니다. 일반적으로 QIterator는 직접 사용해서는 안 되며, QMetaSequence::Iterable 및 QMetaAssociation::Iterable 에서 제공하는 파생 클래스를 통해 사용해야 합니다.
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)는 이터레이터를 컨테이너의 다음 항목으로 이동시키고, 새로운 현재 항목에 대한 이터레이터를 반환합니다.
QMetaSequence::Iterable::constEnd()에서 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
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)는 앞의 항목을 현재 항목으로 지정하고, 새로운 현재 항목에 대한 이터레이터를 반환합니다.
QMetaSequence::Iterable::constBegin()에서 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
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!=()도 참조하십시오 .
© 2026 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.