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 Class Reference

\reentrant More...

#include <qtextobject.h>

+ Collaboration diagram for QTextBlock:

Classes

class  iterator
 \reentrant More...
 

Public Types

typedef iterator Iterator
 Qt-style synonym for QTextBlock::iterator.
 

Public Member Functions

 QTextBlock (QTextDocumentPrivate *priv, int b)
 
 QTextBlock ()
 
 QTextBlock (const QTextBlock &o)
 Copies the other text block's attributes to this text block.
 
QTextBlockoperator= (const QTextBlock &o)
 Assigns the other text block to this text block.
 
bool isValid () const
 Returns true if this text block is valid; otherwise returns false.
 
bool operator== (const QTextBlock &o) const
 Returns true if this text block is the same as the other text block.
 
bool operator!= (const QTextBlock &o) const
 Returns true if this text block is different from the other text block.
 
bool operator< (const QTextBlock &o) const
 Returns true if this text block occurs before the other text block in the document.
 
int position () const
 Returns the index of the block's first character within the document.
 
int length () const
 Returns the length of the block in characters.
 
bool contains (int position) const
 Returns true if the given position is located within the text block; otherwise returns false.
 
QTextLayoutlayout () const
 Returns the QTextLayout that is used to lay out and display the block's contents.
 
void clearLayout ()
 
QTextBlockFormat blockFormat () const
 Returns the QTextBlockFormat that describes block-specific properties.
 
int blockFormatIndex () const
 Returns an index into the document's internal list of block formats for the text block's format.
 
QTextCharFormat charFormat () const
 Returns the QTextCharFormat that describes the block's character format.
 
int charFormatIndex () const
 Returns an index into the document's internal list of character formats for the text block's character format.
 
Qt::LayoutDirection textDirection () const
 
QString text () const
 Returns the block's contents as plain text.
 
QList< QTextLayout::FormatRangetextFormats () const
 
const QTextDocumentdocument () const
 Returns the text document this text block belongs to, or \nullptr if the text block does not belong to any document.
 
QTextListtextList () const
 If the block represents a list item, returns the list that the item belongs to; otherwise returns \nullptr.
 
QTextBlockUserDatauserData () const
 
void setUserData (QTextBlockUserData *data)
 
int userState () const
 
void setUserState (int state)
 
int revision () const
 
void setRevision (int rev)
 
bool isVisible () const
 
void setVisible (bool visible)
 
int blockNumber () const
 
int firstLineNumber () const
 
void setLineCount (int count)
 
int lineCount () const
 
iterator begin () const
 Returns a text block iterator pointing to the beginning of the text block.
 
iterator end () const
 Returns a text block iterator pointing to the end of the text block.
 
QTextBlock next () const
 Returns the text block in the document after this block, or an empty text block if this is the last one.
 
QTextBlock previous () const
 Returns the text block in the document before this block, or an empty text block if this is the first one.
 
int fragmentIndex () const
 

Friends

class QSyntaxHighlighter
 
class QTextDocumentPrivate
 
class QTextLayout
 

Detailed Description

\reentrant

The QTextBlock class provides a container for text fragments in a QTextDocument. \inmodule QtGui

A text block encapsulates a block or paragraph of text in a QTextDocument. QTextBlock provides read-only access to the block/paragraph structure of QTextDocuments. It is mainly of use if you want to implement your own layouts for the visual representation of a QTextDocument, or if you want to iterate over a document and write out the contents in your own custom format.

Text blocks are created by their parent documents. If you need to create a new text block, or modify the contents of a document while examining its contents, use the cursor-based interface provided by QTextCursor instead.

Each text block is located at a specific position() in a document(). The contents of the block can be obtained by using the text() function. The length() function determines the block's size within the document (including formatting characters). The visual properties of the block are determined by its text layout(), its charFormat(), and its blockFormat().

The next() and previous() functions enable iteration over consecutive valid blocks in a document under the condition that the document is not modified by other means during the iteration process. Note that, although blocks are returned in sequence, adjacent blocks may come from different places in the document structure. The validity of a block can be determined by calling isValid().

QTextBlock provides comparison operators to make it easier to work with blocks: \l operator==() compares two block for equality, \l operator!=() compares two blocks for inequality, and \l operator<() determines whether a block precedes another in the same document.

See also
QTextBlockFormat, QTextCharFormat, QTextFragment

Definition at line 156 of file qtextobject.h.

Member Typedef Documentation

◆ Iterator

Qt-style synonym for QTextBlock::iterator.

Definition at line 234 of file qtextobject.h.

Constructor & Destructor Documentation

◆ QTextBlock() [1/3]

QTextBlock::QTextBlock ( QTextDocumentPrivate * priv,
int b )
inline

Definition at line 160 of file qtextobject.h.

◆ QTextBlock() [2/3]

QTextBlock::QTextBlock ( )
inline

Definition at line 161 of file qtextobject.h.

◆ QTextBlock() [3/3]

QTextBlock::QTextBlock ( const QTextBlock & o)
inline

Copies the other text block's attributes to this text block.

Definition at line 162 of file qtextobject.h.

Member Function Documentation

◆ begin()

QTextBlock::iterator QTextBlock::begin ( ) const

Returns a text block iterator pointing to the beginning of the text block.

See also
end()

Definition at line 1420 of file qtextobject.cpp.

References QTextFrame::iterator, pos, and position().

Referenced by QWidgetTextControlPrivate::activateLinkUnderCursor(), QQuickTextControlPrivate::activateLinkUnderCursor(), QQuickTextNodeEngine::addTextBlock(), QWidgetTextControl::anchorPosition(), QWidgetTextControl::findNextPrevAnchor(), main(), QSyntaxHighlighter::setDocument(), QTextMarkdownWriter::writeBlock(), and QTextOdfWriter::writeBlock().

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

◆ blockFormat()

QTextBlockFormat QTextBlock::blockFormat ( ) const

Returns the QTextBlockFormat that describes block-specific properties.

See also
charFormat()

Definition at line 1005 of file qtextobject.cpp.

References QTextFormat::toBlockFormat().

Referenced by QTextList::add(), QQuickTextNodeEngine::addTextBlock(), QTextCursor::blockFormat(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QTextCopyHelper::copy(), QTextEditPrivate::hoveredBlockWithMarkerChanged(), QQuickTextControlPrivate::hoverEvent(), isEmptyBlockBeforeTable(), QTextList::itemText(), QTextDocumentLayoutPrivate::layoutFlow(), QWidgetTextControlPrivate::mouseReleaseEvent(), QQuickTextControlPrivate::mouseReleaseEvent(), QPlainTextEdit::paintEvent(), QTextList::remove(), QTextMarkdownWriter::writeBlock(), and QTextMarkdownWriter::writeFrame().

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

◆ blockFormatIndex()

int QTextBlock::blockFormatIndex ( ) const

Returns an index into the document's internal list of block formats for the text block's format.

See also
QTextDocument::allFormats()

Definition at line 1019 of file qtextobject.cpp.

Referenced by QTextOdfWriter::writeBlock().

+ Here is the caller graph for this function:

◆ blockNumber()

int QTextBlock::blockNumber ( ) const
Since
4.4
Returns the number of this block, or -1 if the block is invalid.

\sa QTextCursor::blockNumber()

Definition at line 1362 of file qtextobject.cpp.

Referenced by QPlainTextEditControl::blockBoundingRect(), QTextCursor::blockNumber(), QPlainTextDocumentLayout::documentChanged(), QPlainTextEditPrivate::ensureVisible(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEditPrivate::setTopBlock(), QPlainTextEditPrivate::setTopLine(), and QQuickTextEdit::updatePaintNode().

+ Here is the caller graph for this function:

◆ charFormat()

QTextCharFormat QTextBlock::charFormat ( ) const

Returns the QTextCharFormat that describes the block's character format.

The block's character format is used when inserting text into an empty block.

See also
blockFormat()

Definition at line 1034 of file qtextobject.cpp.

References QTextFormat::toCharFormat().

Referenced by QQuickTextNodeEngine::addTextBlock(), QTextCursor::blockCharFormat(), QAbstractTextDocumentLayout::blockWithMarkerAt(), and QScriptLine::setDefaultHeight().

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

◆ charFormatIndex()

int QTextBlock::charFormatIndex ( ) const

Returns an index into the document's internal list of character formats for the text block's character format.

See also
QTextDocument::allFormats()

Definition at line 1048 of file qtextobject.cpp.

◆ clearLayout()

void QTextBlock::clearLayout ( )
Since
4.4 Clears the QTextLayout that is used to lay out and display the block's contents.
See also
layout()

Definition at line 990 of file qtextobject.cpp.

References QTextLayout::clearLayout(), and QTextBlockData::layout.

Referenced by QTextDocumentLayout::documentChanged(), and QPlainTextDocumentLayout::documentChanged().

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

◆ contains()

bool QTextBlock::contains ( int position) const

Returns true if the given position is located within the text block; otherwise returns false.

Definition at line 952 of file qtextobject.cpp.

References pos, and position().

Referenced by QPlainTextEdit::paintEvent().

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

◆ document()

const QTextDocument * QTextBlock::document ( ) const

Returns the text document this text block belongs to, or \nullptr if the text block does not belong to any document.

Definition at line 1190 of file qtextobject.cpp.

Referenced by QTextDocumentLayout::positionInlineObject(), QSyntaxHighlighter::rehighlightBlock(), and QPlainTextDocumentLayoutPrivate::relayout().

+ Here is the caller graph for this function:

◆ end()

QTextBlock::iterator QTextBlock::end ( ) const

Returns a text block iterator pointing to the end of the text block.

See also
begin(), next(), previous()

Definition at line 1438 of file qtextobject.cpp.

References QTextFrame::iterator, pos, and position().

Referenced by QWidgetTextControl::findNextPrevAnchor().

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

◆ firstLineNumber()

int QTextBlock::firstLineNumber ( ) const
Since
4.5
Returns the first line number of this block, or -1 if the block is invalid.
Unless the layout supports it, the line number is identical to the block number.

\sa QTextBlock::blockNumber()

Definition at line 1378 of file qtextobject.cpp.

Referenced by QPlainTextEditControl::blockBoundingRect(), QPlainTextEditPrivate::setTopBlock(), and QPlainTextEditPrivate::setTopLine().

+ Here is the caller graph for this function:

◆ fragmentIndex()

int QTextBlock::fragmentIndex ( ) const
inline

Definition at line 242 of file qtextobject.h.

◆ isValid()

bool QTextBlock::isValid ( ) const

Returns true if this text block is valid; otherwise returns false.

Definition at line 813 of file qtextobject.cpp.

Referenced by QQuickTextNodeEngine::addTextBlock(), QTextDocumentLayout::blockBoundingRect(), QPlainTextDocumentLayout::blockBoundingRect(), QPlainTextEditControl::blockBoundingRect(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QTextCursor::columnNumber(), currentTextLine(), currentTextLine(), QWidgetTextControlPrivate::cursorMoveKeyEvent(), QQuickTextControlPrivate::cursorMoveKeyEvent(), QPlainTextDocumentLayout::documentChanged(), QPlainTextDocumentLayout::ensureBlockLayout(), QPlainTextEditPrivate::ensureVisible(), QTextDocument::find(), QWidgetTextControl::findNextPrevAnchor(), QAbstractTextDocumentLayout::formatAt(), QPlainTextEditControl::hitTest(), QTextEditPrivate::hoveredBlockWithMarkerChanged(), QQuickTextControlPrivate::hoverEvent(), QWidgetTextControlPrivate::inputMethodEvent(), QQuickText::invalidateFontCaches(), isEmptyBlockAfterTable(), isEmptyBlockBeforeTable(), isLineSeparatorBlockAfterTable(), QTextDocumentLayoutPrivate::layoutFlow(), QWidgetTextControlPrivate::mouseMoveEvent(), QWidgetTextControlPrivate::mousePressEvent(), QWidgetTextControlPrivate::mouseReleaseEvent(), QQuickTextControlPrivate::mouseReleaseEvent(), QTextLayout::nextCursorPosition(), QTextEngine::nextLogicalPosition(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEdit::paintEvent(), QSyntaxHighlighter::previousBlockState(), QTextLayout::previousCursorPosition(), QTextEngine::previousLogicalPosition(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QSyntaxHighlighterPrivate::reformatBlock(), QSyntaxHighlighterPrivate::reformatBlocks(), QSyntaxHighlighter::rehighlightBlock(), QPlainTextDocumentLayoutPrivate::relayout(), QPlainTextEditPrivate::setTopBlock(), MainWindow::showList(), XmlWriter::toXml(), QQuickTextPrivate::updateSize(), QTextEngine::validate(), QSvgVisitorImpl::visitTextNode(), and QTextMarkdownWriter::writeFrame().

+ Here is the caller graph for this function:

◆ isVisible()

bool QTextBlock::isVisible ( ) const
Since
4.4

Returns true if the block is visible; otherwise returns false.

See also
setVisible()

Definition at line 1328 of file qtextobject.cpp.

References QTextBlockData::hidden.

Referenced by QTextDocumentLayout::blockBoundingRect(), QPlainTextDocumentLayout::blockBoundingRect(), QPlainTextEditControl::blockBoundingRect(), QPlainTextDocumentLayout::documentChanged(), QPlainTextEditPrivate::ensureVisible(), QTextCursor::movePosition(), QPlainTextEdit::paintEvent(), and QPlainTextDocumentLayoutPrivate::relayout().

+ Here is the caller graph for this function:

◆ layout()

QTextLayout * QTextBlock::layout ( ) const

Returns the QTextLayout that is used to lay out and display the block's contents.

Note that the returned QTextLayout object can only be modified from the documentChanged implementation of a QAbstractTextDocumentLayout subclass. Any changes applied from the outside cause undefined behavior.

See also
clearLayout()

Definition at line 972 of file qtextobject.cpp.

References QTextBlockData::layout.

Referenced by QQuickTextNodeEngine::addText(), QQuickTextNodeEngine::addTextBlock(), QQuickTextNodeEngine::addTextObject(), QSyntaxHighlighterPrivate::applyFormatChanges(), QTextDocumentLayout::blockBoundingRect(), QPlainTextDocumentLayout::blockBoundingRect(), QTextCursorPrivate::blockLayout(), QWidgetTextControlPrivate::commitPreedit(), currentTextLine(), currentTextLine(), QWidgetTextControlPrivate::cursorMoveKeyEvent(), QQuickTextControlPrivate::cursorMoveKeyEvent(), QQuickTextEditPrivate::determineHorizontalAlignment(), QSGInternalTextNode::doAddTextDocument(), QPlainTextDocumentLayout::ensureBlockLayout(), QPlainTextEditPrivate::ensureVisible(), flowPosition(), QAbstractTextDocumentLayout::formatAt(), QPlainTextEditControl::hitTest(), QWidgetTextControlPrivate::inputMethodEvent(), QQuickText::invalidateFontCaches(), QWidgetTextControlPrivate::isPreediting(), QTextDocumentLayoutPrivate::layoutFlow(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEdit::paintEvent(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QPlainTextDocumentLayoutPrivate::relayout(), QWidgetTextControlPrivate::sendMouseEventToInputContext(), QQuickTextControlPrivate::sendMouseEventToInputContext(), QQuickTextEdit::updatePaintNode(), QQuickTextPrivate::updateSize(), QPlainTextEditPrivate::verticalOffset(), and QSvgVisitorImpl::visitTextNode().

+ Here is the caller graph for this function:

◆ length()

◆ lineCount()

int QTextBlock::lineCount ( ) const
Since
4.5

Returns the line count. Not all document layouts support this feature.

See also
setLineCount()

Definition at line 1406 of file qtextobject.cpp.

Referenced by QPlainTextDocumentLayout::documentChanged(), and QQuickTextPrivate::updateSize().

+ Here is the caller graph for this function:

◆ next()

◆ operator!=()

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

Returns true if this text block is different from the other text block.

Definition at line 168 of file qtextobject.h.

References o.

◆ operator<()

bool QTextBlock::operator< ( const QTextBlock & o) const
inline

Returns true if this text block occurs before the other text block in the document.

Definition at line 169 of file qtextobject.h.

References o, and position().

+ Here is the call graph for this function:

◆ operator=()

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

Assigns the other text block to this text block.

Definition at line 163 of file qtextobject.h.

References o.

◆ operator==()

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

Returns true if this text block is the same as the other text block.

Definition at line 167 of file qtextobject.h.

References o.

◆ position()

int QTextBlock::position ( ) const

Returns the index of the block's first character within the document.

Definition at line 924 of file qtextobject.cpp.

Referenced by QTextCursor::QTextCursor(), QQuickTextNodeEngine::addText(), QQuickTextNodeEngine::addTextBlock(), QQuickTextNodeEngine::addTextObject(), QSyntaxHighlighterPrivate::applyFormatChanges(), QTextCursor::atBlockEnd(), QTextCursor::atBlockStart(), QTextDocumentLayout::blockBoundingRect(), QTextCursor::charFormat(), QTextCursor::columnNumber(), QTextCopyHelper::copy(), currentTextLine(), currentTextLine(), QSGInternalTextNode::doAddTextDocument(), QPlainTextEditPrivate::ensureVisible(), QWidgetTextControlPrivate::extendWordwiseSelection(), QQuickTextControlPrivate::extendWordwiseSelection(), QTextDocument::find(), findInBlock(), QWidgetTextControl::findNextPrevAnchor(), QAbstractTextDocumentLayout::formatAt(), QTextEngine::formatIndex(), QPlainTextEditControl::hitTest(), QWidgetTextControlPrivate::inputMethodEvent(), QWidgetTextControl::inputMethodQuery(), isEmptyBlockAfterTable(), isEmptyBlockBeforeTable(), isLineSeparatorBlockAfterTable(), QTextEngine::itemize(), QWidgetTextControlPrivate::keyPressEvent(), QQuickTextControlPrivate::keyPressEvent(), QTextBlockGroupPrivate::markBlocksDirty(), QPlainTextEdit::paintEvent(), QTextCursor::positionInBlock(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QSyntaxHighlighterPrivate::reformatBlocks(), QTextDocumentPrivate::setBlockFormat(), QTextLayout::setFormats(), QTextLayout::setPreeditArea(), QTextCursorPrivate::setX(), QTextEngine::shape(), QQuickTextEdit::updatePaintNode(), QTextMarkdownWriter::writeFrame(), and QTextOdfWriter::writeFrame().

+ Here is the caller graph for this function:

◆ previous()

QTextBlock QTextBlock::previous ( ) const

Returns the text block in the document before this block, or an empty text block if this is the first one.

Note that the previous block may be in a different frame or table to this block.

See also
next(), begin(), end()

Definition at line 1475 of file qtextobject.cpp.

Referenced by QPlainTextEditControl::blockBoundingRect(), QWidgetTextControlPrivate::cursorMoveKeyEvent(), QPlainTextEditPrivate::ensureVisible(), QTextDocument::find(), QWidgetTextControl::findNextPrevAnchor(), QPlainTextEditControl::hitTest(), QTextCursorPrivate::movePosition(), QPlainTextEditPrivate::pageUpDown(), QSyntaxHighlighter::previousBlockState(), and QQuickTextPrivate::updateSize().

+ Here is the caller graph for this function:

◆ revision()

int QTextBlock::revision ( ) const
Since
4.4

Returns the blocks revision.

See also
setRevision(), QTextDocument::revision()

Definition at line 1296 of file qtextobject.cpp.

References QTextBlockData::revision.

◆ setLineCount()

void QTextBlock::setLineCount ( int count)
Since
4.5

Sets the line count to count.

See also
lineCount()

Definition at line 1393 of file qtextobject.cpp.

Referenced by QPlainTextDocumentLayout::documentChanged(), and QPlainTextDocumentLayoutPrivate::relayout().

+ Here is the caller graph for this function:

◆ setRevision()

void QTextBlock::setRevision ( int rev)
Since
4.4

Sets a blocks revision to rev.

See also
revision(), QTextDocument::revision()

Definition at line 1312 of file qtextobject.cpp.

References QTextBlockData::revision.

◆ setUserData()

void QTextBlock::setUserData ( QTextBlockUserData * data)
Since
4.1

Attaches the given data object to the text block.

QTextBlockUserData can be used to store custom settings. The ownership is passed to the underlying text document, i.e. the provided QTextBlockUserData object will be deleted if the corresponding text block gets deleted. The user data object is not stored in the undo history, so it will not be available after undoing the deletion of a text block.

For example, if you write a programming editor in an IDE, you may want to let your user set breakpoints visually in your code for an integrated debugger. In a programming editor a line of text usually corresponds to one QTextBlock. The QTextBlockUserData interface allows the developer to store data for each QTextBlock, like for example in which lines of the source code the user has a breakpoint set. Of course this could also be stored externally, but by storing it inside the QTextDocument, it will for example be automatically deleted when the user deletes the associated line. It's really just a way to store custom information in the QTextDocument without using custom properties in QTextFormat which would affect the undo/redo stack.

Definition at line 1249 of file qtextobject.cpp.

References QTextBlockData::userData.

◆ setUserState()

void QTextBlock::setUserState ( int state)
Since
4.1

Stores the specified state integer value in the text block. This may be useful for example in a syntax highlighter to store a text parsing state.

Definition at line 1280 of file qtextobject.cpp.

References state, and QTextBlockData::userState.

◆ setVisible()

void QTextBlock::setVisible ( bool visible)
Since
4.4

Sets the block's visibility to visible.

See also
isVisible()

Definition at line 1344 of file qtextobject.cpp.

References QTextBlockData::hidden.

◆ text()

QString QTextBlock::text ( ) const

Returns the block's contents as plain text.

See also
length(), charFormat(), blockFormat()

Definition at line 1115 of file qtextobject.cpp.

References QTextFrame::end(), QSet< T >::find(), it, pos, position(), QString::reserve(), and text.

Referenced by findInBlock(), QQuickTextControlPrivate::hoverEvent(), QWidgetTextControl::inputMethodQuery(), QWidgetTextControlPrivate::insertParagraphSeparator(), isLineSeparatorBlockAfterTable(), QSyntaxHighlighterPrivate::reformatBlock(), MainWindow::showList(), QQuickTextEdit::updatePaintNode(), QTextEngine::validate(), QTextMarkdownWriter::writeBlock(), and QTextMarkdownWriter::writeFrame().

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

◆ textDirection()

Qt::LayoutDirection QTextBlock::textDirection ( ) const
Since
4.7

Returns the resolved text direction.

If the block has no explicit direction set, it will resolve the direction from the blocks content. Returns either Qt::LeftToRight or Qt::RightToLeft.

See also
QTextFormat::layoutDirection(), QString::isRightToLeft(), Qt::LayoutDirection

Definition at line 1067 of file qtextobject.cpp.

References dir, QTextFrame::end(), QSet< T >::find(), it, Qt::LayoutDirectionAuto, Qt::LeftToRight, pos, position(), and Qt::RightToLeft.

Referenced by QQuickTextNodeEngine::addTextBlock().

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

◆ textFormats()

QList< QTextLayout::FormatRange > QTextBlock::textFormats ( ) const
Since
5.3

Returns the block's text format options as a list of continuous ranges of QTextCharFormat. The range's character format is used when inserting text within the range boundaries.

See also
charFormat(), blockFormat()

Definition at line 1144 of file qtextobject.cpp.

References QTextFormatCollection::charFormat(), QTextFrame::end(), QSet< T >::find(), it, pos, position(), and QTextLayout::FormatRange::start.

Referenced by QSvgVisitorImpl::visitTextNode().

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

◆ textList()

QTextList * QTextBlock::textList ( ) const

If the block represents a list item, returns the list that the item belongs to; otherwise returns \nullptr.

Definition at line 1199 of file qtextobject.cpp.

References QTextObject::document(), fmt, and QTextDocument::objectForFormat().

Referenced by QQuickTextNodeEngine::addTextBlock(), QAbstractTextDocumentLayout::blockWithMarkerAt(), MainWindow::showList(), QTextMarkdownWriter::writeBlock(), QTextOdfWriter::writeBlock(), and QTextMarkdownWriter::writeFrame().

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

◆ userData()

QTextBlockUserData * QTextBlock::userData ( ) const
Since
4.1

Returns a pointer to a QTextBlockUserData object, if one has been set with setUserData(), or \nullptr.

Definition at line 1215 of file qtextobject.cpp.

References QTextBlockData::userData.

◆ userState()

int QTextBlock::userState ( ) const
Since
4.1

Returns the integer value previously set with setUserState() or -1.

Definition at line 1265 of file qtextobject.cpp.

References QTextBlockData::userState.

Referenced by QSyntaxHighlighter::previousBlockState(), and QSyntaxHighlighterPrivate::reformatBlocks().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QSyntaxHighlighter

friend class QSyntaxHighlighter
friend

Definition at line 158 of file qtextobject.h.

◆ QTextDocumentPrivate

friend class QTextDocumentPrivate
friend

Definition at line 247 of file qtextobject.h.

◆ QTextLayout

friend class QTextLayout
friend

Definition at line 248 of file qtextobject.h.


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