Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QTextBlock::iterator Class Reference

\reentrant More...

#include <qtextobject.h>

+ Collaboration diagram for QTextBlock::iterator:

Public Member Functions

constexpr iterator ()=default
 Constructs an iterator for this text block.
 
Q_GUI_EXPORT QTextFragment fragment () const
 Returns the text fragment the iterator currently points to.
 
bool atEnd () const
 Returns true if the current item is the last item in the text block.
 
bool operator== (const iterator &o) const
 Returns true if this iterator is the same as the other iterator; otherwise returns false.
 
bool operator!= (const iterator &o) const
 Returns true if this iterator is different from the other iterator; otherwise returns false.
 
Q_GUI_EXPORT iteratoroperator++ ()
 The prefix ++ operator ({++i}) advances the iterator to the next item in the hash and returns an iterator to the new current item.
 
iterator operator++ (int)
 The postfix ++ operator ({i++}) advances the iterator to the next item in the text block and returns an iterator to the old current item.
 
Q_GUI_EXPORT iteratoroperator-- ()
 The prefix – operator ({–i}) makes the preceding item current and returns an iterator pointing to the new current item.
 
iterator operator-- (int)
 The postfix – operator ({i–}) makes the preceding item current and returns an iterator to the old current item.
 

Friends

class QTextBlock
 

Detailed Description

\reentrant

The QTextBlock::iterator class provides an iterator for reading the contents of a QTextBlock. \inmodule QtGui

A block consists of a sequence of text fragments. This class provides a way to iterate over these, and read their contents. It does not provide a way to modify the internal structure or contents of the block.

An iterator can be constructed and used to access the fragments within a text block in the following way:

for (it = currentBlock.begin(); !(it.atEnd()); ++it) {
QTextFragment currentFragment = it.fragment();
if (currentFragment.isValid())
See also
QTextFragment

Definition at line 210 of file qtextobject.h.

Constructor & Destructor Documentation

◆ iterator()

QTextBlock::iterator::iterator ( )
constexprdefault

Constructs an iterator for this text block.

Member Function Documentation

◆ atEnd()

bool QTextBlock::iterator::atEnd ( ) const
inline

Returns true if the current item is the last item in the text block.

Definition at line 223 of file qtextobject.h.

◆ fragment()

QTextFragment QTextBlock::iterator::fragment ( ) const

Returns the text fragment the iterator currently points to.

Definition at line 1487 of file qtextobject.cpp.

References QTextObject::formatIndex().

+ Here is the call graph for this function:

◆ operator!=()

bool QTextBlock::iterator::operator!= ( const iterator & o) const
inline

Returns true if this iterator is different from the other iterator; otherwise returns false.

Definition at line 226 of file qtextobject.h.

References o.

◆ operator++() [1/2]

QTextBlock::iterator & QTextBlock::iterator::operator++ ( )

The prefix ++ operator ({++i}) advances the iterator to the next item in the hash and returns an iterator to the new current item.

Definition at line 1503 of file qtextobject.cpp.

References QTextObject::formatIndex().

+ Here is the call graph for this function:

◆ operator++() [2/2]

QTextBlock::iterator QTextBlock::iterator::operator++ ( int )
inline

The postfix ++ operator ({i++}) advances the iterator to the next item in the text block and returns an iterator to the old current item.

Definition at line 228 of file qtextobject.h.

References operator++().

Referenced by operator++().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator--() [1/2]

QTextBlock::iterator & QTextBlock::iterator::operator-- ( )

The prefix – operator ({–i}) makes the preceding item current and returns an iterator pointing to the new current item.

Definition at line 1519 of file qtextobject.cpp.

References QTextObject::formatIndex().

+ Here is the call graph for this function:

◆ operator--() [2/2]

QTextBlock::iterator QTextBlock::iterator::operator-- ( int )
inline

The postfix – operator ({i–}) makes the preceding item current and returns an iterator to the old current item.

Definition at line 230 of file qtextobject.h.

References operator--().

Referenced by operator--().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==()

bool QTextBlock::iterator::operator== ( const iterator & o) const
inline

Returns true if this iterator is the same as the other iterator; otherwise returns false.

Definition at line 225 of file qtextobject.h.

References o.

Friends And Related Symbol Documentation

◆ QTextBlock

friend class QTextBlock
friend

Definition at line 215 of file qtextobject.h.


The documentation for this class was generated from the following files: