iterator Class
class QTextBlock::iteratorQTextBlock::iterator 클래스는 QTextBlock...의 내용을 읽기 위한 이터레이터를 제공합니다.. ..
- 상속된 멤버를 포함한 모든 멤버 목록
- 이터레이터는 리치 텍스트 처리 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]
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
을 반환합니다.
© 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.