QTextBlock::iterator Class
class QTextBlock::iteratorQTextBlock::iterator 클래스는 QTextBlock 의 내용을 읽기 위한 이터레이터를 제공합니다. 더 보기...
- 상속된 멤버를 포함한 모든 멤버 목록
- iterator는 리치 텍스트 처리 API의 일부입니다.
공개 함수
| iterator() | |
| bool | atEnd() const |
| QTextFragment | fragment() const |
| bool | operator!=(const QTextBlock::iterator &other) const |
| QTextBlock::iterator & | operator++() |
| QTextBlock::iterator | operator++(int) |
| QTextBlock::iterator & | operator--() |
| QTextBlock::iterator | operator--(int) |
| bool | operator==(const QTextBlock::iterator &other) const |
상세 설명
블록은 일련의 텍스트 조각으로 구성됩니다. 이 클래스는 이러한 조각들을 순회하고 그 내용을 읽을 수 있는 방법을 제공합니다. 블록의 내부 구조나 내용을 수정하는 방법은 제공하지 않습니다.
다음과 같은 방법으로 이터레이터를 생성하여 텍스트 블록 내의 조각에 접근할 수 있습니다.
QTextBlock::iterator it;
for (it = currentBlock.begin(); !(it.atEnd()); ++it) {
QTextFragment currentFragment = it.fragment();
if (currentFragment.isValid())
processFragment(currentFragment);
}QTextFragment도 참조하십시오 .
멤버 함수 문서
[constexpr noexcept default] iterator::iterator()
이 텍스트 블록에 대한 반복자를 생성합니다.
bool iterator::atEnd() const
현재 항목이 텍스트 블록의 마지막 항목인 경우 true 를 반환합니다.
QTextFragment iterator::fragment() const
이터레이터가 현재 가리키고 있는 텍스트 조각을 반환합니다.
bool iterator::operator!=(const QTextBlock::iterator &other) const
이 이터레이터가 ` other ` 이터레이터와 다른 경우 `true`를 반환하고, 그렇지 않은 경우 ` false`를 반환합니다.
QTextBlock::iterator &iterator::operator++()
접두사 ++ 연산자(++i)는 이터레이터를 해시의 다음 항목으로 이동시키고, 새로운 현재 항목을 가리키는 이터레이터를 반환합니다.
QTextBlock::iterator iterator::operator++(int)
포스트픽스 ++ 연산자(i++)는 이터레이터를 텍스트 블록의 다음 항목으로 이동시키고, 이전 현재 항목에 대한 이터레이터를 반환합니다.
QTextBlock::iterator &iterator::operator--()
접두사 연산자(--i)는 바로 앞의 항목을 현재 항목으로 설정하고, 새로운 현재 항목을 가리키는 이터레이터를 반환합니다.
QTextBlock::iterator iterator::operator--(int)
포스트픽스 연산자(i--)는 바로 앞의 항목을 현재 항목으로 설정하고, 이전 현재 항목에 대한 반복자를 반환합니다.
bool iterator::operator==(const QTextBlock::iterator &other) const
이 이터레이터가 ` other ` 이터레이터와 동일한 경우 `true`를 반환하고, 그렇지 않은 경우 ` false`를 반환합니다.
© 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.