![]() |
Qt 6.x
The Qt SDK
|
\reentrant More...
#include <qtextobject.h>
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. | |
QTextBlock & | operator= (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 . | |
QTextLayout * | layout () 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::FormatRange > | textFormats () const |
const QTextDocument * | document () const |
Returns the text document this text block belongs to, or \nullptr if the text block does not belong to any document. | |
QTextList * | textList () const |
If the block represents a list item, returns the list that the item belongs to; otherwise returns \nullptr. | |
QTextBlockUserData * | userData () 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 |
\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.
Definition at line 156 of file qtextobject.h.
Qt-style synonym for QTextBlock::iterator.
Definition at line 234 of file qtextobject.h.
|
inline |
Definition at line 160 of file qtextobject.h.
|
inline |
Definition at line 161 of file qtextobject.h.
|
inline |
Copies the other text block's attributes to this text block.
Definition at line 162 of file qtextobject.h.
QTextBlock::iterator QTextBlock::begin | ( | ) | const |
Returns a text block iterator pointing to the beginning of the text block.
Definition at line 1420 of file qtextobject.cpp.
References e, pos, and position().
Referenced by QWidgetTextControlPrivate::activateLinkUnderCursor(), QQuickTextControlPrivate::activateLinkUnderCursor(), QQuickTextNodeEngine::addTextBlock(), QWidgetTextControl::findNextPrevAnchor(), main(), QTextMarkdownWriter::writeBlock(), and QTextOdfWriter::writeBlock().
QTextBlockFormat QTextBlock::blockFormat | ( | ) | const |
Returns the QTextBlockFormat that describes block-specific properties.
Definition at line 1005 of file qtextobject.cpp.
References QTextFormat::toBlockFormat().
Referenced by QTextList::add(), QQuickTextNodeEngine::addTextBlock(), QTextCursor::blockFormat(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawListItem(), MainWindow::highlightListItems(), QTextDocumentLayoutPrivate::hitTest(), QQuickTextControlPrivate::hoverEvent(), isEmptyBlockBeforeTable(), QTextList::itemText(), QTextDocumentLayoutPrivate::layoutFlow(), QWidgetTextControlPrivate::mouseReleaseEvent(), QQuickTextControlPrivate::mouseReleaseEvent(), QPlainTextEdit::paintEvent(), QTextList::remove(), QTextMarkdownWriter::writeBlock(), and QTextMarkdownWriter::writeFrame().
int QTextBlock::blockFormatIndex | ( | ) | const |
Returns an index into the document's internal list of block formats for the text block's format.
Definition at line 1019 of file qtextobject.cpp.
Referenced by QTextOdfWriter::writeBlock().
int QTextBlock::blockNumber | ( | ) | const |
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().
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.
Definition at line 1034 of file qtextobject.cpp.
References QTextFormat::toCharFormat().
Referenced by QQuickTextNodeEngine::addTextBlock(), QTextCursor::blockCharFormat(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QTextDocumentLayoutPrivate::drawListItem(), QTextDocumentLayoutPrivate::layoutBlock(), and QScriptLine::setDefaultHeight().
int QTextBlock::charFormatIndex | ( | ) | const |
Returns an index into the document's internal list of character formats for the text block's character format.
Definition at line 1048 of file qtextobject.cpp.
void QTextBlock::clearLayout | ( | ) |
Definition at line 990 of file qtextobject.cpp.
References QTextLayout::clearLayout(), and QTextBlockData::layout.
Referenced by QTextDocumentLayout::documentChanged(), and QPlainTextDocumentLayout::documentChanged().
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 QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFlow(), and QPlainTextEdit::paintEvent().
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 QSyntaxHighlighter::rehighlightBlock(), and QPlainTextDocumentLayoutPrivate::relayout().
QTextBlock::iterator QTextBlock::end | ( | ) | const |
Returns a text block iterator pointing to the end of the text block.
Definition at line 1438 of file qtextobject.cpp.
References e, pos, and position().
Referenced by QWidgetTextControl::findNextPrevAnchor().
int QTextBlock::firstLineNumber | ( | ) | const |
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().
|
inline |
Definition at line 242 of file qtextobject.h.
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(), QTextDocumentLayout::documentChanged(), QPlainTextDocumentLayout::documentChanged(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawTableCell(), QPlainTextDocumentLayout::ensureBlockLayout(), QPlainTextEditPrivate::ensureVisible(), QTextDocument::find(), QWidgetTextControl::findNextPrevAnchor(), QAbstractTextDocumentLayout::formatAt(), QPlainTextEditControl::hitTest(), QQuickTextControlPrivate::hoverEvent(), QWidgetTextControlPrivate::inputMethodEvent(), QQuickText::invalidateFontCaches(), isEmptyBlockAfterTable(), isEmptyBlockBeforeTable(), isLineSeparatorBlockAfterTable(), QTextDocumentLayoutPrivate::layoutFlow(), QWidgetTextControlPrivate::mouseMoveEvent(), QWidgetTextControlPrivate::mousePressEvent(), QWidgetTextControlPrivate::mouseReleaseEvent(), QQuickTextControlPrivate::mouseReleaseEvent(), QTextCursorPrivate::movePosition(), 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(), QWidgetTextControl::selectionRect(), QTextDocumentPrivate::setCharFormat(), QPlainTextEditPrivate::setTopBlock(), MainWindow::showList(), MainWindow::showTable(), QTextLine::textLength(), XmlWriter::toXml(), QTextEngine::validate(), and QTextMarkdownWriter::writeFrame().
bool QTextBlock::isVisible | ( | ) | const |
Returns true
if the block is visible; otherwise returns false
.
Definition at line 1328 of file qtextobject.cpp.
References QTextBlockData::hidden.
Referenced by QTextDocumentLayout::blockBoundingRect(), QPlainTextDocumentLayout::blockBoundingRect(), QPlainTextEditControl::blockBoundingRect(), QPlainTextDocumentLayout::documentChanged(), QTextDocumentLayoutPrivate::drawBlock(), QPlainTextEditPrivate::ensureVisible(), QTextDocumentLayoutPrivate::layoutBlock(), QTextCursor::movePosition(), QPlainTextEdit::paintEvent(), and QPlainTextDocumentLayoutPrivate::relayout().
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.
Definition at line 972 of file qtextobject.cpp.
References QTextBlockData::layout.
Referenced by QQuickTextNodeEngine::addText(), QQuickTextNodeEngine::addTextBlock(), QQuickTextNode::addTextDocument(), QQuickTextNodeEngine::addTextObject(), QSyntaxHighlighterPrivate::applyFormatChanges(), QTextDocumentLayout::blockBoundingRect(), QPlainTextDocumentLayout::blockBoundingRect(), QTextCursorPrivate::blockLayout(), QWidgetTextControlPrivate::commitPreedit(), currentTextLine(), currentTextLine(), QWidgetTextControlPrivate::cursorMoveKeyEvent(), QQuickTextControlPrivate::cursorMoveKeyEvent(), QQuickTextEditPrivate::determineHorizontalAlignment(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawListItem(), QPlainTextDocumentLayout::ensureBlockLayout(), QPlainTextEditPrivate::ensureVisible(), flowPosition(), QAbstractTextDocumentLayout::formatAt(), QPlainTextEditControl::hitTest(), QTextDocumentLayoutPrivate::hitTest(), QWidgetTextControlPrivate::inputMethodEvent(), QQuickText::invalidateFontCaches(), QWidgetTextControlPrivate::isPreediting(), QTextDocumentLayoutPrivate::layoutBlock(), QTextDocumentLayoutPrivate::layoutFlow(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEdit::paintEvent(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QPlainTextDocumentLayoutPrivate::relayout(), QWidgetTextControl::selectionRect(), QWidgetTextControlPrivate::sendMouseEventToInputContext(), QQuickTextControlPrivate::sendMouseEventToInputContext(), QQuickTextEdit::updatePaintNode(), QQuickTextPrivate::updateSize(), and QPlainTextEditPrivate::verticalOffset().
int QTextBlock::length | ( | ) | const |
Returns the length of the block in characters.
Definition at line 940 of file qtextobject.cpp.
Referenced by QQuickTextNodeEngine::addTextBlock(), QSyntaxHighlighterPrivate::applyFormatChanges(), QTextCursor::atBlockEnd(), QTextDocumentLayout::blockBoundingRect(), QTextCursor::charFormat(), QPlainTextDocumentLayout::documentChanged(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocument::find(), QWidgetTextControl::findNextPrevAnchor(), QTextEngine::formatIndex(), QTextDocumentLayoutPrivate::hitTest(), QWidgetTextControl::inputMethodQuery(), isEmptyBlockAfterTable(), isEmptyBlockBeforeTable(), isLineSeparatorBlockAfterTable(), QTextEngine::itemize(), QWidgetTextControlPrivate::keyPressEvent(), QQuickTextControlPrivate::keyPressEvent(), QTextDocumentLayoutPrivate::layoutBlock(), QTextBlockGroupPrivate::markBlocksDirty(), QTextTable::mergeCells(), QTextCursorPrivate::movePosition(), QTextLayout::nextCursorPosition(), QTextEngine::nextLogicalPosition(), QPlainTextEdit::paintEvent(), QTextLayout::previousCursorPosition(), QTextEngine::previousLogicalPosition(), QSyntaxHighlighterPrivate::reformatBlock(), QSyntaxHighlighterPrivate::reformatBlocks(), QTextCursor::select(), QTextDocumentPrivate::setBlockFormat(), QTextLayout::setFormats(), QTextLayout::setPreeditArea(), QQuickTextEdit::updatePaintNode(), and QTextOdfWriter::writeBlock().
int QTextBlock::lineCount | ( | ) | const |
Returns the line count. Not all document layouts support this feature.
Definition at line 1406 of file qtextobject.cpp.
Referenced by QPlainTextDocumentLayout::documentChanged(), and QQuickTextPrivate::updateSize().
QTextBlock QTextBlock::next | ( | ) | const |
Returns the text block in the document after this block, or an empty text block if this is the last one.
Note that the next block may be in a different frame or table to this block.
Definition at line 1459 of file qtextobject.cpp.
Referenced by QPlainTextDocumentLayout::blockBoundingRect(), QPlainTextEditControl::blockBoundingRect(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QWidgetTextControlPrivate::cursorMoveKeyEvent(), QQuickTextControlPrivate::cursorMoveKeyEvent(), QTextDocumentLayout::documentChanged(), QPlainTextDocumentLayout::documentChanged(), QTextDocument::find(), QWidgetTextControl::findNextPrevAnchor(), QAbstractTextDocumentLayout::formatAt(), QPlainTextEditControl::hitTest(), QQuickText::invalidateFontCaches(), QTextCursor::movePosition(), QTextCursorPrivate::movePosition(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEdit::paintEvent(), QSyntaxHighlighterPrivate::reformatBlocks(), QPlainTextDocumentLayoutPrivate::relayout(), QTextDocumentPrivate::setBlockFormat(), QTextDocumentPrivate::setCharFormat(), XmlWriter::toXml(), QQuickTextEdit::updatePaintNode(), QQuickTextPrivate::updateSize(), and QTextEngine::validate().
|
inline |
Returns true
if this text block is different from the other text block.
Definition at line 168 of file qtextobject.h.
References o.
|
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().
|
inline |
Assigns the other text block to this text block.
Definition at line 163 of file qtextobject.h.
References o.
|
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.
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(), QQuickTextNode::addTextDocument(), QQuickTextNodeEngine::addTextObject(), QSyntaxHighlighterPrivate::applyFormatChanges(), QTextCursor::atBlockEnd(), QTextCursor::atBlockStart(), QTextDocumentLayout::blockBoundingRect(), QTextCursor::charFormat(), QTextCursor::columnNumber(), QTextCopyHelper::copy(), currentTextLine(), currentTextLine(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFrame(), QPlainTextEditPrivate::ensureVisible(), QWidgetTextControlPrivate::extendWordwiseSelection(), QQuickTextControlPrivate::extendWordwiseSelection(), QTextDocument::find(), findInBlock(), QWidgetTextControl::findNextPrevAnchor(), QAbstractTextDocumentLayout::formatAt(), QTextEngine::formatIndex(), MainWindow::highlightListItems(), QPlainTextEditControl::hitTest(), QTextDocumentLayoutPrivate::hitTest(), QWidgetTextControlPrivate::inputMethodEvent(), QWidgetTextControl::inputMethodQuery(), isEmptyBlockAfterTable(), isEmptyBlockBeforeTable(), isLineSeparatorBlockAfterTable(), QTextEngine::itemize(), QWidgetTextControlPrivate::keyPressEvent(), QQuickTextControlPrivate::keyPressEvent(), QTextBlockGroupPrivate::markBlocksDirty(), QTextCursorPrivate::movePosition(), QPlainTextEdit::paintEvent(), QTextCursor::positionInBlock(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QSyntaxHighlighterPrivate::reformatBlocks(), QWidgetTextControl::selectionRect(), QTextDocumentPrivate::setBlockFormat(), QTextLayout::setFormats(), QTextLayout::setPreeditArea(), QTextCursorPrivate::setX(), QTextEngine::shape(), QQuickTextEdit::updatePaintNode(), QTextMarkdownWriter::writeFrame(), and QTextOdfWriter::writeFrame().
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.
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(), and QQuickTextPrivate::updateSize().
int QTextBlock::revision | ( | ) | const |
Returns the blocks revision.
Definition at line 1296 of file qtextobject.cpp.
References QTextBlockData::revision.
void QTextBlock::setLineCount | ( | int | count | ) |
Sets the line count to count.
Definition at line 1393 of file qtextobject.cpp.
Referenced by QPlainTextDocumentLayout::documentChanged(), and QPlainTextDocumentLayoutPrivate::relayout().
void QTextBlock::setRevision | ( | int | rev | ) |
Sets a blocks revision to rev.
Definition at line 1312 of file qtextobject.cpp.
References QTextBlockData::revision.
void QTextBlock::setUserData | ( | QTextBlockUserData * | data | ) |
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.
void QTextBlock::setUserState | ( | int | state | ) |
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.
void QTextBlock::setVisible | ( | bool | visible | ) |
Sets the block's visibility to visible.
Definition at line 1344 of file qtextobject.cpp.
References QTextBlockData::hidden.
QString QTextBlock::text | ( | ) | const |
Returns the block's contents as plain text.
Definition at line 1115 of file qtextobject.cpp.
References QTextFrame::end(), QSet< T >::find(), it, pos, position(), QString::reserve(), QFragment< N >::size_array, QTextFragmentData::stringPosition, and text.
Referenced by findInBlock(), QQuickTextControlPrivate::hoverEvent(), QWidgetTextControl::inputMethodQuery(), QWidgetTextControlPrivate::insertParagraphSeparator(), isLineSeparatorBlockAfterTable(), QTextCursorPrivate::movePosition(), QSyntaxHighlighterPrivate::reformatBlock(), MainWindow::showList(), MainWindow::showTable(), QQuickTextEdit::updatePaintNode(), QTextEngine::validate(), QTextMarkdownWriter::writeBlock(), and QTextMarkdownWriter::writeFrame().
Qt::LayoutDirection QTextBlock::textDirection | ( | ) | const |
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.
Definition at line 1067 of file qtextobject.cpp.
References dir, QChar::DirAL, QChar::direction(), QChar::DirL, QChar::DirR, QTextFrame::end(), QSet< T >::find(), QChar::isHighSurrogate(), QChar::isLowSurrogate(), it, Qt::LayoutDirectionAuto, Qt::LeftToRight, pos, position(), Qt::RightToLeft, QFragment< N >::size_array, QTextFragmentData::stringPosition, and QChar::surrogateToUcs4().
Referenced by QQuickTextNodeEngine::addTextBlock(), QTextDocumentLayoutPrivate::drawListItem(), QTextList::itemText(), QTextDocumentLayoutPrivate::layoutBlock(), and QTextCursorPrivate::movePosition().
QList< QTextLayout::FormatRange > QTextBlock::textFormats | ( | ) | const |
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.
Definition at line 1144 of file qtextobject.cpp.
References QTextFormatCollection::charFormat(), QTextFrame::end(), QSet< T >::find(), QTextFragmentData::format, it, pos, position(), and QFragment< N >::size_array.
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().
QTextBlockUserData * QTextBlock::userData | ( | ) | const |
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.
int QTextBlock::userState | ( | ) | const |
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().
|
friend |
Definition at line 158 of file qtextobject.h.
|
friend |
Definition at line 247 of file qtextobject.h.
|
friend |
Definition at line 248 of file qtextobject.h.