iterator Class
class QTextBlock::iteratorQTextBlock::iterator クラスは、QTextBlock の内容を読み取るためのイテレータを提供する。詳細...
- 継承メンバを含む全メンバ一覧
- iterator はRich Text Processing 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 イテレータと異なる場合は真を返し、そうでない場合はfalse
を返す。
QTextBlock::iterator &iterator::operator++()
接頭辞 ++ 演算子 (++i
) は、イテレータをハッシュの次の項目に進め、新しい現在の項目へのイテレータを返します。
QTextBlock::iterator iterator::operator++(int)
ポストフィックス ++ 演算子 (i++
) は、イテレータをテキストブロックの次の項目に進め、古い現在の項目へのイテレータを返します。
QTextBlock::iterator &iterator::operator--()
接頭辞 - 演算子 (--i
) は、直前の項目を現在の項目にし、新しい現在の項目を指すイテレータを返します。
QTextBlock::iterator iterator::operator--(int)
postfix - 演算子 (i--
) は、直前の項目を現在の項目にし、古い現在の項目へのイテレータを返します。
bool iterator::operator==(const QTextBlock::iterator &other) const
このイテレータがother イテレータと同じであれば真を返し、そうでなければ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.