![]() |
Qt 6.x
The Qt SDK
|
\reentrant More...
#include <qtextobject.h>
Public Member Functions | |
constexpr | iterator () noexcept=default |
Constructs an invalid iterator. | |
QTextFrame * | parentFrame () const |
Returns the parent frame of the current frame. | |
QTextFrame * | currentFrame () 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 iterator & | operator++ () |
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 iterator & | operator-- () |
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 |
\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.
|
constexprdefaultnoexcept |
Constructs an invalid iterator.
|
inline |
Returns true
if the current item is the last item in the text frame.
Definition at line 122 of file qtextobject.h.
Referenced by isEmptyBlockBeforeTable(), and QTextDocumentLayoutPrivate::layoutFlow().
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.
Definition at line 628 of file qtextobject.cpp.
References QTextDocumentPrivate::get().
Referenced by QTextDocumentLayoutPrivate::layoutFlow().
|
inline |
Returns the current frame pointed to by the iterator, or \nullptr if the iterator currently points to a block.
Definition at line 119 of file qtextobject.h.
Referenced by isEmptyBlockBeforeTable(), and QTextDocumentLayoutPrivate::layoutFlow().
|
inline |
Returns true if the iterator is different from the other iterator; otherwise returns false
.
Definition at line 125 of file qtextobject.h.
QTextFrame::iterator & QTextFrame::iterator::operator++ | ( | ) |
Moves the iterator to the next frame or block.
Definition at line 640 of file qtextobject.cpp.
References cb, e, QTextDocumentPrivate::get(), map, QChar::ParagraphSeparator, pos, priv(), Q_ASSERT, QTextBeginningOfFrame, and QTextEndOfFrame.
|
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++().
QTextFrame::iterator & QTextFrame::iterator::operator-- | ( | ) |
Moves the iterator to the previous frame or block.
Definition at line 678 of file qtextobject.cpp.
References cb, e, QTextFrame::end(), QTextDocumentPrivate::get(), map, QChar::ParagraphSeparator, pos, priv(), Q_ASSERT, QTextBeginningOfFrame, and QTextEndOfFrame.
|
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--().
|
inline |
Returns true if the iterator is the same as the other iterator; otherwise returns false
.
Definition at line 124 of file qtextobject.h.
|
inline |
Returns the parent frame of the current frame.
Definition at line 117 of file qtextobject.h.
|
friend |
Definition at line 111 of file qtextobject.h.
|
friend |
Definition at line 109 of file qtextobject.h.
|
friend |
Definition at line 110 of file qtextobject.h.