이 페이지에서

QIterable Class

template <typename Container> class QIterable

QIterable은 QMetaSequence::Iterable 및 QMetaAssociation::Iterable 의 기반 클래스인 템플릿 클래스입니다. 더 보기...

헤더: #include <QIterable>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
다음부터: Qt 6.0
상속된 버전:

QAssociativeIterable 및 QSequentialIterable

공개 함수

bool canForwardIterate() const
bool canInputIterate() const
bool canRandomAccessIterate() const
bool canReverseIterate() const
void clear()
QConstIterator<Container> constBegin() const
QConstIterator<Container> constEnd() const
QIterator<Container> mutableBegin()
QIterator<Container> mutableEnd()
qsizetype size() const

상세 설명

QIterable<Container>는 QVariant 를 통해 컨테이너를 반복 처리하기 위한 공통 인터페이스를 제공하며, 여기서 Container 는 컨테이너의 반복 처리 기능을 정의하는 메타타입 설명자( QMetaSequence 또는 QMetaAssociation)입니다.

멤버 함수 문서

bool QIterable::canForwardIterate() const

컨테이너를 정방향으로 반복 처리할 수 있는지 여부를 반환합니다. 이는 컨테이너의 iterator 및 const_iterator에 대한 std::forward_iterator_tag 이터레이터 트레이트에 해당합니다.

bool QIterable::canInputIterate() const

컨테이너에 입력 이터레이터가 있는지 여부를 반환합니다. 이는 컨테이너의 이터레이터 및 const_iterator에 대한 std::input_iterator_tag 이터레이터 트레이트에 해당합니다.

bool QIterable::canRandomAccessIterate() const

이터레이터를 사용하여 여러 값을 효율적으로 건너뛸 수 있는지 여부를 반환합니다. 이는 컨테이너의 이터레이터 및 const_iterator에 대한 std::random_access_iterator_tag 이터레이터 트레이트와 일치합니다.

bool QIterable::canReverseIterate() const

컨테이너를 역순으로 반복할 수 있는지 여부를 반환합니다. 이는 컨테이너의 const_iterator에 대한 std::bidirectional_iterator_tag 이터레이터 트레이트와 일치합니다.

void QIterable::clear()

컨테이너를 비웁니다.

QConstIterator<Container> QIterable::constBegin() const

컨테이너의 시작 부분을 나타내는 QConstIterator 를 반환합니다. 이는 STL 스타일의 반복 처리에서 사용할 수 있습니다.

constEnd() 및 mutableBegin()도 참조하십시오 .

QConstIterator<Container> QIterable::constEnd() const

컨테이너의 끝을 가리키는 Qterable::QConstIterator를 반환합니다. 이는 STL 스타일의 반복 처리에 사용할 수 있습니다.

constBegin() 및 mutableEnd()도 참조하십시오 .

QIterator<Container> QIterable::mutableBegin()

컨테이너의 시작 지점에 대한 ` QIterator `를 반환합니다. 이는 STL 스타일의 반복 처리에서 사용할 수 있습니다.

mutableEnd() 및 constBegin()도 참조하십시오 .

QIterator<Container> QIterable::mutableEnd()

컨테이너의 끝을 가리키는 QMetaSequence::Iterable::iterator를 반환합니다. 이는 STL 스타일의 반복 처리에 사용할 수 있습니다.

mutableBegin() 및 constEnd()도 참조하십시오 .

qsizetype QIterable::size() const

컨테이너에 포함된 값의 개수를 반환합니다.

참고: 기본 컨테이너가 크기를 조회할 수 있는 기본 제공 방법을 제공하지 않는경우 , 이 메서드는 반복자를 사용하여 액세스를 합성합니다. 이 동작은 더 이상 권장되지 않으며, 향후 Qt 버전에서 제거될 예정입니다.

© 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.