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
QTextFrame::iterator Class Reference

\reentrant More...

#include <qtextobject.h>

+ Collaboration diagram for QTextFrame::iterator:

Public Member Functions

constexpr iterator () noexcept=default
 Constructs an invalid iterator.
 
QTextFrameparentFrame () const
 Returns the parent frame of the current frame.
 
QTextFramecurrentFrame () const
 Returns the current frame pointed to by the iterator, or \nullptr if the iterator currently points to a block.
 
Q_GUI_EXPORT QTextBlock currentBlock () const
 Returns the current block the iterator points to.
 
bool atEnd () const
 Returns true if the current item is the last item in the text frame.
 
bool operator== (const iterator &o) const
 Returns true if the iterator is the same as the other iterator; otherwise returns false.
 
bool operator!= (const iterator &o) const
 Returns true if the iterator is different from the other iterator; otherwise returns false.
 
Q_GUI_EXPORT iteratoroperator++ ()
 Moves the iterator to the next frame or block.
 
iterator operator++ (int)
 The postfix {++} operator ({i++}) advances the iterator to the next item in the text frame, and returns an iterator to the old item.
 
Q_GUI_EXPORT iteratoroperator-- ()
 Moves the iterator to the previous frame or block.
 
iterator operator-- (int)
 The postfix {–} operator ({i–}) makes the preceding item in the current frame, and returns an iterator to the old item.
 

Friends

class QTextFrame
 
class QTextTableCell
 
class QTextDocumentLayoutPrivate
 

Detailed Description

\reentrant

The iterator class provides an iterator for reading the contents of a QTextFrame.

\inmodule QtGui

A frame consists of an arbitrary sequence of \l{QTextBlock}s and child \l{QTextFrame}s. This class provides a way to iterate over the child objects of a frame, and read their contents. It does not provide a way to modify the contents of the frame.

Definition at line 102 of file qtextobject.h.

Constructor & Destructor Documentation

◆ iterator()

QTextFrame::iterator::iterator ( )
constexprdefaultnoexcept

Constructs an invalid iterator.

Member Function Documentation

◆ atEnd()

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

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

Definition at line 122 of file qtextobject.h.

References cb.

◆ currentBlock()

QTextBlock QTextFrame::iterator::currentBlock ( ) const

Returns the current block the iterator points to.

If the iterator points to a child frame, the returned block is invalid.

See also
currentFrame()

Definition at line 628 of file qtextobject.cpp.

References QTextDocumentPrivate::get().

+ Here is the call graph for this function:

◆ currentFrame()

QTextFrame * QTextFrame::iterator::currentFrame ( ) const
inline

Returns the current frame pointed to by the iterator, or \nullptr if the iterator currently points to a block.

See also
currentBlock()

Definition at line 119 of file qtextobject.h.

◆ operator!=()

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

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

Definition at line 125 of file qtextobject.h.

References cb, and o.

◆ operator++() [1/2]

QTextFrame::iterator & QTextFrame::iterator::operator++ ( )

Moves the iterator to the next frame or block.

See also
currentBlock(), currentFrame()

Definition at line 640 of file qtextobject.cpp.

References cb, QTextDocumentPrivate::get(), map, pos, priv(), Q_ASSERT, QTextBeginningOfFrame, and QTextEndOfFrame.

+ Here is the call graph for this function:

◆ operator++() [2/2]

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

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

Definition at line 127 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]

QTextFrame::iterator & QTextFrame::iterator::operator-- ( )

Moves the iterator to the previous frame or block.

See also
currentBlock(), currentFrame()

Definition at line 678 of file qtextobject.cpp.

References cb, QTextFrame::end(), QTextDocumentPrivate::get(), map, pos, priv(), Q_ASSERT, QTextBeginningOfFrame, and QTextEndOfFrame.

+ Here is the call graph for this function:

◆ operator--() [2/2]

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

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

Definition at line 129 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 QTextFrame::iterator::operator== ( const iterator & o) const
inline

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

Definition at line 124 of file qtextobject.h.

References cb, and o.

◆ parentFrame()

QTextFrame * QTextFrame::iterator::parentFrame ( ) const
inline

Returns the parent frame of the current frame.

See also
currentFrame(), QTextFrame::parentFrame()

Definition at line 117 of file qtextobject.h.

Friends And Related Symbol Documentation

◆ QTextDocumentLayoutPrivate

friend class QTextDocumentLayoutPrivate
friend

Definition at line 111 of file qtextobject.h.

◆ QTextFrame

friend class QTextFrame
friend

Definition at line 109 of file qtextobject.h.

◆ QTextTableCell

friend class QTextTableCell
friend

Definition at line 110 of file qtextobject.h.


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