このページでは

QTextBlock::iterator Class

class QTextBlock::iterator

QTextBlock::iterator クラスは、QTextBlock の内容を読み取るためのイテレータを提供します。詳細...

パブリック関数

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.