Qt 4.8
|
The QTextCursor class offers an API to access and modify QTextDocuments. More...
#include <qtextcursor.h>
Public Types | |
enum | MoveMode { MoveAnchor, KeepAnchor } |
If the anchor() is kept where it is and the position() is moved, the text in between will be selected. More... | |
enum | MoveOperation { NoMove, Start, Up, StartOfLine, StartOfBlock, StartOfWord, PreviousBlock, PreviousCharacter, PreviousWord, Left, WordLeft, End, Down, EndOfLine, EndOfWord, EndOfBlock, NextBlock, NextCharacter, NextWord, Right, WordRight, NextCell, PreviousCell, NextRow, PreviousRow } |
enum | SelectionType { WordUnderCursor, LineUnderCursor, BlockUnderCursor, Document } |
This enum describes the types of selection that can be applied with the select() function. More... | |
Public Functions | |
int | anchor () const |
Returns the anchor position; this is the same as position() unless there is a selection in which case position() marks one end of the selection and anchor() marks the other end. More... | |
bool | atBlockEnd () const |
Returns true if the cursor is at the end of a block; otherwise returns false. More... | |
bool | atBlockStart () const |
Returns true if the cursor is at the start of a block; otherwise returns false. More... | |
bool | atEnd () const |
Returns true if the cursor is at the end of the document; otherwise returns false. More... | |
bool | atStart () const |
Returns true if the cursor is at the start of the document; otherwise returns false. More... | |
void | beginEditBlock () |
Indicates the start of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view. More... | |
QTextBlock | block () const |
Returns the block that contains the cursor. More... | |
QTextCharFormat | blockCharFormat () const |
Returns the block character format of the block the cursor is in. More... | |
QTextBlockFormat | blockFormat () const |
Returns the block format of the block the cursor is in. More... | |
int | blockNumber () const |
Returns the number of the block the cursor is in, or 0 if the cursor is invalid. More... | |
QTextCharFormat | charFormat () const |
Returns the format of the character immediately before the cursor position(). More... | |
void | clearSelection () |
Clears the current selection by setting the anchor to the cursor position. More... | |
int | columnNumber () const |
Returns the position of the cursor within its containing line. More... | |
QTextList * | createList (const QTextListFormat &format) |
Creates and returns a new list with the given format, and makes the current paragraph the cursor is in the first list item. More... | |
QTextList * | createList (QTextListFormat::Style style) |
Creates and returns a new list with the given style, making the cursor's current paragraph the first list item. More... | |
QTextFrame * | currentFrame () const |
Returns a pointer to the current frame. More... | |
QTextList * | currentList () const |
Returns the current list if the cursor position() is inside a block that is part of a list; otherwise returns 0. More... | |
QTextTable * | currentTable () const |
Returns a pointer to the current table if the cursor position() is inside a block that is part of a table; otherwise returns 0. More... | |
void | deleteChar () |
If there is no selected text, deletes the character at the current cursor position; otherwise deletes the selected text. More... | |
void | deletePreviousChar () |
If there is no selected text, deletes the character before the current cursor position; otherwise deletes the selected text. More... | |
QTextDocument * | document () const |
Returns the document this cursor is associated with. More... | |
void | endEditBlock () |
Indicates the end of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view. More... | |
bool | hasComplexSelection () const |
Returns true if the cursor contains a selection that is not simply a range from selectionStart() to selectionEnd(); otherwise returns false. More... | |
bool | hasSelection () const |
Returns true if the cursor contains a selection; otherwise returns false. More... | |
void | insertBlock () |
Inserts a new empty block at the cursor position() with the current blockFormat() and charFormat(). More... | |
void | insertBlock (const QTextBlockFormat &format) |
Inserts a new empty block at the cursor position() with block format format and the current charFormat() as block char format. More... | |
void | insertBlock (const QTextBlockFormat &format, const QTextCharFormat &charFormat) |
Inserts a new empty block at the cursor position() with block format format and charFormat as block char format. More... | |
void | insertFragment (const QTextDocumentFragment &fragment) |
Inserts the text fragment at the current position(). More... | |
QTextFrame * | insertFrame (const QTextFrameFormat &format) |
Inserts a frame with the given format at the current cursor position(), moves the cursor position() inside the frame, and returns the frame. More... | |
void | insertHtml (const QString &html) |
Inserts the text html at the current position(). More... | |
void | insertImage (const QTextImageFormat &format, QTextFrameFormat::Position alignment) |
Inserts the image defined by the given format at the cursor's current position with the specified alignment. More... | |
void | insertImage (const QTextImageFormat &format) |
Inserts the image defined by format at the current position(). More... | |
void | insertImage (const QString &name) |
Convenience method for inserting the image with the given name at the current position(). More... | |
void | insertImage (const QImage &image, const QString &name=QString()) |
Convenience function for inserting the given image with an optional name at the current position(). More... | |
QTextList * | insertList (const QTextListFormat &format) |
Inserts a new block at the current position and makes it the first list item of a newly created list with the given format. More... | |
QTextList * | insertList (QTextListFormat::Style style) |
Inserts a new block at the current position and makes it the first list item of a newly created list with the given style. More... | |
QTextTable * | insertTable (int rows, int cols, const QTextTableFormat &format) |
Creates a new table with the given number of rows and columns in the specified format, inserts it at the current cursor position() in the document, and returns the table object. More... | |
QTextTable * | insertTable (int rows, int cols) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Creates a new table with the given number of rows and columns, inserts it at the current cursor position() in the document, and returns the table object. More... | |
void | insertText (const QString &text) |
Inserts text at the current position, using the current character format. More... | |
void | insertText (const QString &text, const QTextCharFormat &format) |
Inserts text at the current position with the given format. More... | |
bool | isCopyOf (const QTextCursor &other) const |
Returns true if this cursor and other are copies of each other, i.e. More... | |
bool | isNull () const |
Returns true if the cursor is null; otherwise returns false. More... | |
void | joinPreviousEditBlock () |
Like beginEditBlock() indicates the start of a block of editing operations that should appear as a single operation for undo/redo. More... | |
bool | keepPositionOnInsert () const |
Returns whether the cursor should keep its current position when text gets inserted at the position of the cursor. More... | |
void | mergeBlockCharFormat (const QTextCharFormat &modifier) |
Modifies the block char format of the current block (or all blocks that are contained in the selection) with the block format specified by modifier. More... | |
void | mergeBlockFormat (const QTextBlockFormat &modifier) |
Modifies the block format of the current block (or all blocks that are contained in the selection) with the block format specified by modifier. More... | |
void | mergeCharFormat (const QTextCharFormat &modifier) |
Merges the cursor's current character format with the properties described by format modifier. More... | |
bool | movePosition (MoveOperation op, MoveMode=MoveAnchor, int n=1) |
Moves the cursor by performing the given operation n times, using the specified mode, and returns true if all operations were completed successfully; otherwise returns false. More... | |
bool | operator!= (const QTextCursor &rhs) const |
Returns true if the other cursor is at a different position in the document as this cursor; otherwise returns false. More... | |
bool | operator< (const QTextCursor &rhs) const |
Returns true if the other cursor is positioned later in the document than this cursor; otherwise returns false. More... | |
bool | operator<= (const QTextCursor &rhs) const |
Returns true if the other cursor is positioned later or at the same position in the document as this cursor; otherwise returns false. More... | |
QTextCursor & | operator= (const QTextCursor &other) |
Makes a copy of cursor and assigns it to this QTextCursor. More... | |
bool | operator== (const QTextCursor &rhs) const |
Returns true if the other cursor is at the same position in the document as this cursor; otherwise returns false. More... | |
bool | operator> (const QTextCursor &rhs) const |
Returns true if the other cursor is positioned earlier in the document than this cursor; otherwise returns false. More... | |
bool | operator>= (const QTextCursor &rhs) const |
Returns true if the other cursor is positioned earlier or at the same position in the document as this cursor; otherwise returns false. More... | |
int | position () const |
Returns the absolute position of the cursor within the document. More... | |
int | positionInBlock () const |
Returns the relative position of the cursor within the block. More... | |
QTextCursor () | |
Constructs a null cursor. More... | |
QTextCursor (QTextDocument *document) | |
Constructs a cursor pointing to the beginning of the document. More... | |
QTextCursor (QTextDocumentPrivate *p, int pos) | |
QTextCursor (QTextFrame *frame) | |
Constructs a cursor pointing to the beginning of the frame. More... | |
QTextCursor (const QTextBlock &block) | |
Constructs a cursor pointing to the beginning of the block. More... | |
QTextCursor (QTextCursorPrivate *d) | |
QTextCursor (const QTextCursor &cursor) | |
Constructs a new cursor that is a copy of cursor. More... | |
void | removeSelectedText () |
If there is a selection, its content is deleted; otherwise does nothing. More... | |
void | select (SelectionType selection) |
Selects text in the document according to the given selection. More... | |
void | selectedTableCells (int *firstRow, int *numRows, int *firstColumn, int *numColumns) const |
If the selection spans over table cells, firstRow is populated with the number of the first row in the selection, firstColumn with the number of the first column in the selection, and numRows and numColumns with the number of rows and columns in the selection. More... | |
QString | selectedText () const |
Returns the current selection's text (which may be empty). More... | |
QTextDocumentFragment | selection () const |
Returns the current selection (which may be empty) with all its formatting information. More... | |
int | selectionEnd () const |
Returns the end of the selection or position() if the cursor doesn't have a selection. More... | |
int | selectionStart () const |
Returns the start of the selection or position() if the cursor doesn't have a selection. More... | |
void | setBlockCharFormat (const QTextCharFormat &format) |
Sets the block char format of the current block (or all blocks that are contained in the selection) to format. More... | |
void | setBlockFormat (const QTextBlockFormat &format) |
Sets the block format of the current block (or all blocks that are contained in the selection) to format. More... | |
void | setCharFormat (const QTextCharFormat &format) |
Sets the cursor's current character format to the given format. More... | |
void | setKeepPositionOnInsert (bool b) |
Defines whether the cursor should keep its current position when text gets inserted at the current position of the cursor. More... | |
void | setPosition (int pos, MoveMode mode=MoveAnchor) |
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified by m. More... | |
void | setVerticalMovementX (int x) |
Sets the visual x position for vertical cursor movements to x. More... | |
void | setVisualNavigation (bool b) |
Sets visual navigation to b. More... | |
int | verticalMovementX () const |
Returns the visual x position for vertical cursor movements. More... | |
bool | visualNavigation () const |
Returns true if the cursor does visual navigation; otherwise returns false. More... | |
~QTextCursor () | |
Destroys the QTextCursor. More... | |
Properties | |
QSharedDataPointer< QTextCursorPrivate > | d |
Friends | |
class | QTextControlPrivate |
class | QTextCopyHelper |
class | QTextDocumentFragmentPrivate |
The QTextCursor class offers an API to access and modify QTextDocuments.
Text cursors are objects that are used to access and modify the contents and underlying structure of text documents via a programming interface that mimics the behavior of a cursor in a text editor. QTextCursor contains information about both the cursor's position within a QTextDocument and any selection that it has made.
QTextCursor is modeled on the way a text cursor behaves in a text editor, providing a programmatic means of performing standard actions through the user interface. A document can be thought of as a single string of characters. The cursor's current position() then is always either between two consecutive characters in the string, or else before the very first character or after the very last character in the string. Documents can also contain tables, lists, images, and other objects in addition to text but, from the developer's point of view, the document can be treated as one long string. Some portions of that string can be considered to lie within particular blocks (e.g. paragraphs), or within a table's cell, or a list's item, or other structural elements. When we refer to "current character" we mean the character immediately before the cursor position() in the document. Similarly, the "current block" is the block that contains the cursor position().
A QTextCursor also has an anchor() position. The text that is between the anchor() and the position() is the selection. If anchor() == position() there is no selection.
The cursor position can be changed programmatically using setPosition() and movePosition(); the latter can also be used to select text. For selections see selectionStart(), selectionEnd(), hasSelection(), clearSelection(), and removeSelectedText().
If the position() is at the start of a block atBlockStart() returns true; and if it is at the end of a block atBlockEnd() returns true. The format of the current character is returned by charFormat(), and the format of the current block is returned by blockFormat().
Formatting can be applied to the current text document using the setCharFormat(), mergeCharFormat(), setBlockFormat() and mergeBlockFormat() functions. The 'set' functions will replace the cursor's current character or block format, while the 'merge' functions add the given format properties to the cursor's current format. If the cursor has a selection the given format is applied to the current selection. Note that when only parts of a block is selected the block format is applied to the entire block. The text at the current character position can be turned into a list using createList().
Deletions can be achieved using deleteChar(), deletePreviousChar(), and removeSelectedText().
Text strings can be inserted into the document with the insertText() function, blocks (representing new paragraphs) can be inserted with insertBlock().
Existing fragments of text can be inserted with insertFragment() but, if you want to insert pieces of text in various formats, it is usually still easier to use insertText() and supply a character format.
Various types of higher-level structure can also be inserted into the document with the cursor:
Actions can be grouped (i.e. treated as a single action for undo/redo) using beginEditBlock() and endEditBlock().
Cursor movements are limited to valid cursor positions. In Latin writing this is between any two consecutive characters in the text, before the first character, or after the last character. In some other writing systems cursor movements are limited to "clusters" (e.g. a syllable in Devanagari, or a base letter plus diacritics). Functions such as movePosition() and deleteChar() limit cursor movement to these valid positions.
Definition at line 70 of file qtextcursor.h.
If the anchor() is kept where it is and the position() is moved, the text in between will be selected.
Enumerator | |
---|---|
MoveAnchor | |
KeepAnchor |
Definition at line 85 of file qtextcursor.h.
Definition at line 99 of file qtextcursor.h.
This enum describes the types of selection that can be applied with the select() function.
Enumerator | |
---|---|
WordUnderCursor | |
LineUnderCursor | |
BlockUnderCursor | |
Document |
Definition at line 144 of file qtextcursor.h.
QTextCursor::QTextCursor | ( | ) |
|
explicit |
Constructs a cursor pointing to the beginning of the document.
Definition at line 1077 of file qtextcursor.cpp.
QTextCursor::QTextCursor | ( | QTextDocumentPrivate * | p, |
int | pos | ||
) |
Definition at line 1105 of file qtextcursor.cpp.
|
explicit |
Constructs a cursor pointing to the beginning of the frame.
Definition at line 1085 of file qtextcursor.cpp.
|
explicit |
Constructs a cursor pointing to the beginning of the block.
Definition at line 1095 of file qtextcursor.cpp.
|
explicit |
Definition at line 1116 of file qtextcursor.cpp.
QTextCursor::QTextCursor | ( | const QTextCursor & | cursor | ) |
QTextCursor::~QTextCursor | ( | ) |
int QTextCursor::anchor | ( | ) | const |
Returns the anchor position; this is the same as position() unless there is a selection in which case position() marks one end of the selection and anchor() marks the other end.
Just like the cursor position, the anchor position is between characters.
Definition at line 1230 of file qtextcursor.cpp.
Referenced by QTextBrowserPrivate::createHistoryEntry(), QTextControlPrivate::cursorMoveKeyEvent(), QDeclarativeTextEdit::moveCursorSelection(), QTextControlPrivate::repaintOldAndNewSelection(), QDeclarativeTextEdit::setCursorPosition(), QTextControl::setExtraSelections(), and setPosition().
bool QTextCursor::atBlockEnd | ( | ) | const |
Returns true if the cursor is at the end of a block; otherwise returns false.
Definition at line 2008 of file qtextcursor.cpp.
bool QTextCursor::atBlockStart | ( | ) | const |
Returns true if the cursor is at the start of a block; otherwise returns false.
Definition at line 1994 of file qtextcursor.cpp.
Referenced by QTextEdit::keyPressEvent(), QPlainTextEdit::keyReleaseEvent(), and QTextEdit::keyReleaseEvent().
bool QTextCursor::atEnd | ( | ) | const |
Returns true if the cursor is at the end of the document; otherwise returns false.
Definition at line 2041 of file qtextcursor.cpp.
bool QTextCursor::atStart | ( | ) | const |
Returns true if the cursor is at the start of the document; otherwise returns false.
Definition at line 2022 of file qtextcursor.cpp.
void QTextCursor::beginEditBlock | ( | ) |
Indicates the start of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view.
For example:
The call to undo() will cause both insertions to be undone, causing both "World" and "Hello" to be removed.
It is possible to nest calls to beginEditBlock and endEditBlock. The top-most pair will determine the scope of the undo/redo operation.
Definition at line 2552 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append(), QTextControlPrivate::createAutoBulletList(), QTextEditPrivate::createAutoBulletList(), QTextControlPrivate::dropEvent(), QTextHtmlImporter::import(), QSyntaxHighlighterPrivate::rehighlight(), QDeclarativeTextEdit::select(), QTextControlPrivate::setContent(), QSyntaxHighlighter::setDocument(), QDeclarativeTextEditPrivate::updateSelection(), and QDeclarativeJS::TextWriter::write_helper().
QTextBlock QTextCursor::block | ( | ) | const |
Returns the block that contains the cursor.
Definition at line 1812 of file qtextcursor.cpp.
Referenced by charFormat(), QAccessibleTextEdit::childAt(), columnNumber(), currentTextLine(), QTextControlPrivate::cursorMoveKeyEvent(), QScriptDebuggerCodeView::event(), QTextControlPrivate::extendWordwiseSelection(), QScriptEdit::extraAreaMouseEvent(), QTextControlPrivate::indent(), QPlainTextEdit::keyReleaseEvent(), QTextEdit::keyReleaseEvent(), QTextTable::mergeCells(), QDeclarativeTextEdit::positionAt(), QTextHtmlImporter::processBlockNode(), select(), and QTextEdit::setText().
QTextCharFormat QTextCursor::blockCharFormat | ( | ) | const |
Returns the block character format of the block the cursor is in.
The block char format is the format used when inserting text at the beginning of an empty block.
Definition at line 1869 of file qtextcursor.cpp.
Referenced by QTextDocumentPrivate::ensureMaximumBlockCount(), and QTextHtmlImporter::processBlockNode().
QTextBlockFormat QTextCursor::blockFormat | ( | ) | const |
Returns the block format of the block the cursor is in.
Definition at line 1824 of file qtextcursor.cpp.
Referenced by QTextHtmlImporter::appendNodeText(), QAccessibleTextWidget::attributes(), QTextControlPrivate::createAutoBulletList(), QTextEditPrivate::createAutoBulletList(), currentList(), QTextHtmlImporter::import(), QTextControlPrivate::indent(), insertBlock(), insertText(), QPlainTextEdit::keyReleaseEvent(), QTextEdit::keyReleaseEvent(), QTextControlPrivate::outdent(), and QTextHtmlImporter::processBlockNode().
int QTextCursor::blockNumber | ( | ) | const |
Returns the number of the block the cursor is in, or 0 if the cursor is invalid.
Note that this function only makes sense in documents without complex objects such as tables or frames.
Definition at line 2623 of file qtextcursor.cpp.
Referenced by QScriptEdit::currentLineNumber(), QScriptDebuggerCodeView::event(), and QScriptEdit::extraAreaMouseEvent().
QTextCharFormat QTextCursor::charFormat | ( | ) | const |
Returns the format of the character immediately before the cursor position().
If the cursor is positioned at the beginning of a text block that is not empty then the format of the character immediately after the cursor is returned.
Definition at line 1914 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::activateLinkUnderCursor(), QTextControlPrivate::anchorForCursor(), QTextHtmlImporter::appendNodeText(), QAccessibleTextWidget::attributes(), QTextDocumentLayoutPrivate::drawListItem(), QTextDocumentFragmentPrivate::insert(), insertBlock(), insertText(), QTextBrowser::keyPressEvent(), QPlainTextEdit::keyPressEvent(), QTextEdit::keyPressEvent(), mergeCharFormat(), QTextControlPrivate::setContent(), and QTextControlPrivate::updateCurrentCharFormat().
void QTextCursor::clearSelection | ( | ) |
Clears the current selection by setting the anchor to the cursor position.
Note that it does not delete the text of the selection.
Definition at line 1677 of file qtextcursor.cpp.
Referenced by QDeclarativeTextEdit::deselect(), QLabel::focusOutEvent(), QAccessibleTextWidget::removeSelection(), select(), QTextBrowserPrivate::setSource(), and QScriptEdit::updateExtraSelections().
int QTextCursor::columnNumber | ( | ) | const |
Returns the position of the cursor within its containing line.
Note that this is the column number relative to a wrapped line, not relative to the block (i.e. the paragraph).
You probably want to call positionInBlock() instead.
Definition at line 2646 of file qtextcursor.cpp.
QTextList * QTextCursor::createList | ( | const QTextListFormat & | format | ) |
Creates and returns a new list with the given format, and makes the current paragraph the cursor is in the first list item.
Definition at line 2142 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::createAutoBulletList(), QTextEditPrivate::createAutoBulletList(), createList(), QTextControlPrivate::indent(), insertList(), and QTextHtmlImporter::processBlockNode().
QTextList * QTextCursor::createList | ( | QTextListFormat::Style | style | ) |
Creates and returns a new list with the given style, making the cursor's current paragraph the first list item.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The style to be used is defined by the QTextListFormat::Style enum.
Definition at line 2167 of file qtextcursor.cpp.
QTextFrame * QTextCursor::currentFrame | ( | ) | const |
Returns a pointer to the current frame.
Returns 0 if the cursor is invalid.
Definition at line 2277 of file qtextcursor.cpp.
Referenced by boundingRectOfFloatsInSelection(), QTextControlPrivate::repaintOldAndNewSelection(), QTextHtmlImporter::scanTable(), and QTextControl::selectionRect().
QTextList * QTextCursor::currentList | ( | ) | const |
Returns the current list if the cursor position() is inside a block that is part of a list; otherwise returns 0.
Definition at line 2180 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::indent(), QTextEdit::keyPressEvent(), QPlainTextEdit::keyReleaseEvent(), QTextEdit::keyReleaseEvent(), and QTextControlPrivate::outdent().
QTextTable * QTextCursor::currentTable | ( | ) | const |
Returns a pointer to the current table if the cursor position() is inside a block that is part of a table; otherwise returns 0.
Definition at line 2240 of file qtextcursor.cpp.
Referenced by QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawFrame(), QTextControlPrivate::gotoNextTableCell(), QTextControlPrivate::gotoPreviousTableCell(), and QTextControl::selectionRect().
void QTextCursor::deleteChar | ( | ) |
If there is no selected text, deletes the character at the current cursor position; otherwise deletes the selected text.
Definition at line 1530 of file qtextcursor.cpp.
Referenced by QLabelPrivate::ensureTextPopulated(), QTextControlPrivate::keyPressEvent(), and QTextEdit::setText().
void QTextCursor::deletePreviousChar | ( | ) |
If there is no selected text, deletes the character before the current cursor position; otherwise deletes the selected text.
Definition at line 1554 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::keyPressEvent(), QPlainTextEdit::keyReleaseEvent(), QTextEdit::keyReleaseEvent(), and QTextEdit::setText().
QTextDocument * QTextCursor::document | ( | ) | const |
Returns the document this cursor is associated with.
Definition at line 2675 of file qtextcursor.cpp.
Referenced by QLabelPrivate::ensureTextPopulated().
void QTextCursor::endEditBlock | ( | ) |
Indicates the end of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view.
Definition at line 2593 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append(), QTextControlPrivate::createAutoBulletList(), QTextEditPrivate::createAutoBulletList(), QTextControlPrivate::dropEvent(), QTextHtmlImporter::import(), QSyntaxHighlighterPrivate::rehighlight(), QDeclarativeTextEdit::select(), QTextControlPrivate::setContent(), QSyntaxHighlighter::setDocument(), QDeclarativeTextEditPrivate::updateSelection(), and QDeclarativeJS::TextWriter::write_helper().
bool QTextCursor::hasComplexSelection | ( | ) | const |
Returns true if the cursor contains a selection that is not simply a range from selectionStart() to selectionEnd(); otherwise returns false.
Complex selections are ones that span at least two cells in a table; their extent is specified by selectedTableCells().
Definition at line 1640 of file qtextcursor.cpp.
Referenced by QTextCopyHelper::copy(), QTextTable::mergeCells(), QTextControlPrivate::repaintOldAndNewSelection(), and QTextControl::selectionRect().
bool QTextCursor::hasSelection | ( | ) | const |
Returns true if the cursor contains a selection; otherwise returns false.
Definition at line 1627 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::_q_deleteSelected(), QTextControlPrivate::anchorForCursor(), QAccessibleTextEdit::copyText(), QTextBrowserPrivate::createHistoryEntry(), QAccessibleTextEdit::cutText(), QTextDocumentLayoutPrivate::drawBlock(), QLabel::focusOutEvent(), QTextBrowser::keyPressEvent(), QPlainTextEdit::keyPressEvent(), QTextEdit::keyPressEvent(), QPlainTextEdit::paintEvent(), QTextDocumentFragment::QTextDocumentFragment(), QTextDocumentFragmentPrivate::QTextDocumentFragmentPrivate(), QTextControlPrivate::repaintOldAndNewSelection(), QAccessibleTextWidget::selection(), QTextControlPrivate::selectionChanged(), QAccessibleTextWidget::selectionCount(), QTextControl::selectionRect(), and QTextControlPrivate::setClipboardSelection().
void QTextCursor::insertBlock | ( | ) |
Inserts a new empty block at the cursor position() with the current blockFormat() and charFormat().
Definition at line 2055 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append(), QTextHtmlImporter::appendBlock(), insertBlock(), insertList(), QTextTable::mergeCells(), and QTextEdit::setText().
void QTextCursor::insertBlock | ( | const QTextBlockFormat & | format | ) |
Inserts a new empty block at the cursor position() with block format format and the current charFormat() as block char format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 2071 of file qtextcursor.cpp.
void QTextCursor::insertBlock | ( | const QTextBlockFormat & | format, |
const QTextCharFormat & | charFormat | ||
) |
Inserts a new empty block at the cursor position() with block format format and charFormat as block char format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 2090 of file qtextcursor.cpp.
void QTextCursor::insertFragment | ( | const QTextDocumentFragment & | fragment | ) |
Inserts the text fragment at the current position().
Definition at line 2289 of file qtextcursor.cpp.
Referenced by QTextDocument::clone(), insertHtml(), and QTextControl::print().
QTextFrame * QTextCursor::insertFrame | ( | const QTextFrameFormat & | format | ) |
Inserts a frame with the given format at the current cursor position(), moves the cursor position() inside the frame, and returns the frame.
If the cursor holds a selection, the whole selection is moved inside the frame.
Definition at line 2264 of file qtextcursor.cpp.
Referenced by QTextHtmlImporter::scanTable().
void QTextCursor::insertHtml | ( | const QString & | html | ) |
Inserts the text html at the current position().
Definition at line 2319 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append().
void QTextCursor::insertImage | ( | const QTextImageFormat & | format, |
QTextFrameFormat::Position | alignment | ||
) |
Inserts the image defined by the given format at the cursor's current position with the specified alignment.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 2341 of file qtextcursor.cpp.
Referenced by insertImage(), and QTextHtmlImporter::processSpecialNodes().
void QTextCursor::insertImage | ( | const QTextImageFormat & | format | ) |
Inserts the image defined by format at the current position().
Definition at line 2363 of file qtextcursor.cpp.
void QTextCursor::insertImage | ( | const QString & | name | ) |
Convenience method for inserting the image with the given name at the current position().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 2379 of file qtextcursor.cpp.
Convenience function for inserting the given image with an optional name at the current position().
Definition at line 2396 of file qtextcursor.cpp.
QTextList * QTextCursor::insertList | ( | const QTextListFormat & | format | ) |
Inserts a new block at the current position and makes it the first list item of a newly created list with the given format.
Returns the created list.
Definition at line 2112 of file qtextcursor.cpp.
QTextList * QTextCursor::insertList | ( | QTextListFormat::Style | style | ) |
Inserts a new block at the current position and makes it the first list item of a newly created list with the given style.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the created list.
Definition at line 2130 of file qtextcursor.cpp.
QTextTable * QTextCursor::insertTable | ( | int | rows, |
int | columns, | ||
const QTextTableFormat & | format | ||
) |
Creates a new table with the given number of rows and columns in the specified format, inserts it at the current cursor position() in the document, and returns the table object.
The cursor is moved to the beginning of the first cell.
There must be at least one row and one column in the table.
Definition at line 2220 of file qtextcursor.cpp.
Referenced by insertTable(), and QTextHtmlImporter::scanTable().
QTextTable * QTextCursor::insertTable | ( | int | rows, |
int | columns | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Creates a new table with the given number of rows and columns, inserts it at the current cursor position() in the document, and returns the table object.
The cursor is moved to the beginning of the first cell.
There must be at least one row and one column in the table.
Definition at line 2203 of file qtextcursor.cpp.
void QTextCursor::insertText | ( | const QString & | text | ) |
Inserts text at the current position, using the current character format.
If there is a selection, the selection is deleted and replaced by text, for example:
This clears any existing selection, selects the word at the cursor (i.e. from position() forward), and replaces the selection with the phrase "Hello World".
Any ASCII linefeed characters (\n) in the inserted text are transformed into unicode block separators, corresponding to insertBlock() calls.
Definition at line 1439 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append(), QTextHtmlImporter::appendNodeText(), QDeclarativeJS::TextWriter::doReplace(), QTextDocumentFragment::fromPlainText(), QTextControlPrivate::inputMethodEvent(), insertImage(), QAccessibleTextWidget::insertText(), QTextTable::mergeCells(), QTextDocument::QTextDocument(), QAccessibleTextWidget::replaceText(), QTextDocument::setPlainText(), and QAccessibleTextEdit::setText().
void QTextCursor::insertText | ( | const QString & | text, |
const QTextCharFormat & | format | ||
) |
Inserts text at the current position with the given format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1455 of file qtextcursor.cpp.
bool QTextCursor::isCopyOf | ( | const QTextCursor & | other | ) | const |
Returns true if this cursor and other are copies of each other, i.e.
one of them was created as a copy of the other and neither has moved since. This is much stricter than equality.
Definition at line 2608 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::_q_emitCursorPosChanged().
bool QTextCursor::isNull | ( | ) | const |
Returns true if the cursor is null; otherwise returns false.
A null cursor is created by the default constructor.
Definition at line 1153 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::cursorMoveKeyEvent(), QTextControl::cursorRect(), QPlainTextEdit::cursorRect(), QTextEdit::cursorRect(), QTextControlPrivate::cursorRectPlusUnicodeDirectionMarkers(), QTextControl::find(), QTextDocument::find(), QTextDocumentFragmentPrivate::insert(), and QTextControlPrivate::repaintOldAndNewSelection().
void QTextCursor::joinPreviousEditBlock | ( | ) |
Like beginEditBlock() indicates the start of a block of editing operations that should appear as a single operation for undo/redo.
However unlike beginEditBlock() it does not start a new block but reverses the previous call to endEditBlock() and therefore makes following operations part of the previous edit block created.
For example:
The call to undo() will cause all three insertions to be undone.
Definition at line 2577 of file qtextcursor.cpp.
bool QTextCursor::keepPositionOnInsert | ( | ) | const |
Returns whether the cursor should keep its current position when text gets inserted at the position of the cursor.
The default is false;
Definition at line 1391 of file qtextcursor.cpp.
void QTextCursor::mergeBlockCharFormat | ( | const QTextCharFormat & | modifier | ) |
Modifies the block char format of the current block (or all blocks that are contained in the selection) with the block format specified by modifier.
Definition at line 1898 of file qtextcursor.cpp.
Referenced by QTextHtmlImporter::processBlockNode().
void QTextCursor::mergeBlockFormat | ( | const QTextBlockFormat & | modifier | ) |
Modifies the block format of the current block (or all blocks that are contained in the selection) with the block format specified by modifier.
Definition at line 1853 of file qtextcursor.cpp.
Referenced by createList(), QSplashScreen::drawContents(), QTextControlPrivate::indent(), QTextControlPrivate::outdent(), QTextHtmlImporter::processBlockNode(), QTextHtmlImporter::processSpecialNodes(), and QTextEdit::setAlignment().
void QTextCursor::mergeCharFormat | ( | const QTextCharFormat & | modifier | ) |
Merges the cursor's current character format with the properties described by format modifier.
If the cursor has a selection, this function applies all the properties set in modifier to all the character formats that are part of the selection.
Definition at line 1974 of file qtextcursor.cpp.
Referenced by QTextHtmlImporter::processSpecialNodes().
bool QTextCursor::movePosition | ( | MoveOperation | operation, |
MoveMode | mode = MoveAnchor , |
||
int | n = 1 |
||
) |
Moves the cursor by performing the given operation n times, using the specified mode, and returns true if all operations were completed successfully; otherwise returns false.
For example, if this function is repeatedly used to seek to the end of the next word, it will eventually fail when the end of the document is reached.
By default, the move operation is performed once (n = 1).
If mode is KeepAnchor
, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.
Definition at line 1258 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::activateLinkUnderCursor(), QTextControlPrivate::anchorForCursor(), QPlainTextEditPrivate::append(), QTextControlPrivate::append(), QAccessibleTextWidget::characterCount(), QTextControlPrivate::cursorMoveKeyEvent(), QTextDocumentPrivate::ensureMaximumBlockCount(), QLabelPrivate::ensureTextPopulated(), QTextControlPrivate::extendBlockwiseSelection(), QTextControlPrivate::extendWordwiseSelection(), QScriptDebuggerCodeView::find(), QTextDocumentFragmentPrivate::insert(), QDeclarativeTextEdit::moveCursorSelection(), QTextEditPrivate::pageUpDown(), QPlainTextEditPrivate::pageUpDown(), QTextHtmlImporter::processSpecialNodes(), QTextDocumentFragment::QTextDocumentFragment(), QSyntaxHighlighterPrivate::rehighlight(), select(), and QTextEdit::setText().
bool QTextCursor::operator!= | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is at a different position in the document as this cursor; otherwise returns false.
Definition at line 2420 of file qtextcursor.cpp.
bool QTextCursor::operator< | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is positioned later in the document than this cursor; otherwise returns false.
Definition at line 2434 of file qtextcursor.cpp.
bool QTextCursor::operator<= | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is positioned later or at the same position in the document as this cursor; otherwise returns false.
Definition at line 2457 of file qtextcursor.cpp.
QTextCursor & QTextCursor::operator= | ( | const QTextCursor & | cursor | ) |
Makes a copy of cursor and assigns it to this QTextCursor.
Note that QTextCursor is an Implicitly Shared Classes{implicitly shared} class.
Definition at line 1136 of file qtextcursor.cpp.
bool QTextCursor::operator== | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is at the same position in the document as this cursor; otherwise returns false.
Definition at line 2479 of file qtextcursor.cpp.
Referenced by operator!=().
bool QTextCursor::operator> | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is positioned earlier in the document than this cursor; otherwise returns false.
Definition at line 2522 of file qtextcursor.cpp.
bool QTextCursor::operator>= | ( | const QTextCursor & | rhs | ) | const |
Returns true if the other cursor is positioned earlier or at the same position in the document as this cursor; otherwise returns false.
Definition at line 2500 of file qtextcursor.cpp.
int QTextCursor::position | ( | ) | const |
Returns the absolute position of the cursor within the document.
The cursor is positioned between characters.
Definition at line 1196 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::activateLinkUnderCursor(), QTextControlPrivate::anchorForCursor(), QTextHtmlImporter::appendNodeText(), QTextTable::cellAt(), QAccessibleTextWidget::characterCount(), QTextBrowserPrivate::createHistoryEntry(), currentTextLine(), QTextControlPrivate::cursorMoveKeyEvent(), QAccessibleTextWidget::cursorPosition(), QTextControl::cursorRect(), QTextControlPrivate::cursorRectPlusUnicodeDirectionMarkers(), QTextDocumentLayoutPrivate::drawBlock(), QLabelPrivate::ensureTextPopulated(), QScriptDebuggerCodeView::event(), QTextControlPrivate::extendBlockwiseSelection(), QTextControlPrivate::extendWordwiseSelection(), findInBlock(), QTextControlPrivate::inputMethodEvent(), QAccessibleTextEdit::invokeMethodEx(), QTextControlPrivate::mouseMoveEvent(), QTextControlPrivate::mousePressEvent(), QTextControlPrivate::mouseReleaseEvent(), QDeclarativeTextEdit::moveCursorSelection(), movePosition(), QPlainTextEdit::paintEvent(), QDeclarativeTextEdit::positionAt(), QTextHtmlImporter::processBlockNode(), QTextCopyHelper::QTextCopyHelper(), QSyntaxHighlighterPrivate::rehighlight(), QTextControlPrivate::repaintOldAndNewSelection(), QTextHtmlImporter::scanTable(), QDeclarativeTextEdit::setCursorPosition(), QTextControl::setExtraSelections(), QTextEdit::setText(), and QTextControl::setTextCursor().
int QTextCursor::positionInBlock | ( | ) | const |
Returns the relative position of the cursor within the block.
The cursor is positioned between characters.
This is equivalent to position() - block().position()
.
Definition at line 1215 of file qtextcursor.cpp.
void QTextCursor::removeSelectedText | ( | ) |
If there is a selection, its content is deleted; otherwise does nothing.
Definition at line 1691 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::_q_deleteSelected(), QPlainTextEditPrivate::append(), deleteChar(), deletePreviousChar(), QAccessibleTextWidget::deleteText(), QTextDocumentPrivate::ensureMaximumBlockCount(), QAccessibleTextWidget::replaceText(), and QTextControlPrivate::startDrag().
void QTextCursor::select | ( | SelectionType | selection | ) |
Selects text in the document according to the given selection.
Definition at line 1588 of file qtextcursor.cpp.
Referenced by QSplashScreen::drawContents(), QDeclarativeTextEdit::selectWord(), QTextControlPrivate::setContent(), and QAccessibleTextEdit::setText().
void QTextCursor::selectedTableCells | ( | int * | firstRow, |
int * | numRows, | ||
int * | firstColumn, | ||
int * | numColumns | ||
) | const |
If the selection spans over table cells, firstRow is populated with the number of the first row in the selection, firstColumn with the number of the first column in the selection, and numRows and numColumns with the number of rows and columns in the selection.
If the selection does not span any table cells the results are harmless but undefined.
Definition at line 1656 of file qtextcursor.cpp.
Referenced by QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawFrame(), QTextTable::mergeCells(), and selectedText().
QString QTextCursor::selectedText | ( | ) | const |
Returns the current selection's text (which may be empty).
This only returns the text, with no rich text formatting information. If you want a document fragment (i.e. formatted rich text) use selection() instead.
character. Use QString::replace() to replace these characters with newlines. Definition at line 1753 of file qtextcursor.cpp.
Referenced by QDeclarativeJS::TextWriter::doMove(), QLabelPrivate::ensureTextPopulated(), and QAccessibleTextWidget::text().
QTextDocumentFragment QTextCursor::selection | ( | ) | const |
Returns the current selection (which may be empty) with all its formatting information.
If you just want the selected text (i.e. plain text) use selectedText() instead.
Definition at line 1804 of file qtextcursor.cpp.
int QTextCursor::selectionEnd | ( | ) | const |
Returns the end of the selection or position() if the cursor doesn't have a selection.
Definition at line 1721 of file qtextcursor.cpp.
Referenced by boundingRectOfFloatsInSelection(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentPrivate::ensureMaximumBlockCount(), QTextControlPrivate::extendBlockwiseSelection(), QTextControlPrivate::extendWordwiseSelection(), QTextDocument::find(), QTextControl::findNextPrevAnchor(), insertFrame(), QPlainTextEdit::paintEvent(), selectedText(), QAccessibleTextWidget::selection(), QTextControl::selectionRect(), QTextControl::setFocusToAnchor(), and QDeclarativeTextEditPrivate::updateSelection().
int QTextCursor::selectionStart | ( | ) | const |
Returns the start of the selection or position() if the cursor doesn't have a selection.
Definition at line 1708 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::activateLinkUnderCursor(), QTextControlPrivate::anchorForCursor(), boundingRectOfFloatsInSelection(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentPrivate::ensureMaximumBlockCount(), QTextControlPrivate::extendBlockwiseSelection(), QTextControlPrivate::extendWordwiseSelection(), QTextDocument::find(), QTextControl::findNextPrevAnchor(), insertFrame(), QPlainTextEdit::paintEvent(), selectedText(), QAccessibleTextWidget::selection(), QTextControl::selectionRect(), QTextControl::setFocusToAnchor(), and QDeclarativeTextEditPrivate::updateSelection().
void QTextCursor::setBlockCharFormat | ( | const QTextCharFormat & | format | ) |
Sets the block char format of the current block (or all blocks that are contained in the selection) to format.
Definition at line 1883 of file qtextcursor.cpp.
Referenced by QTextDocumentPrivate::ensureMaximumBlockCount(), and QTextHtmlImporter::processBlockNode().
void QTextCursor::setBlockFormat | ( | const QTextBlockFormat & | format | ) |
Sets the block format of the current block (or all blocks that are contained in the selection) to format.
Definition at line 1838 of file qtextcursor.cpp.
Referenced by QTextHtmlImporter::appendNodeText(), QTextControlPrivate::createAutoBulletList(), QTextEditPrivate::createAutoBulletList(), QTextHtmlImporter::import(), QPlainTextEdit::keyReleaseEvent(), QTextEdit::keyReleaseEvent(), and QTextHtmlImporter::processBlockNode().
void QTextCursor::setCharFormat | ( | const QTextCharFormat & | format | ) |
Sets the cursor's current character format to the given format.
If the cursor has a selection, the given format is applied to the current selection.
Definition at line 1955 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::append(), and QTextControlPrivate::setContent().
void QTextCursor::setKeepPositionOnInsert | ( | bool | b | ) |
Defines whether the cursor should keep its current position when text gets inserted at the current position of the cursor.
If b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor. If b is false, the cursor moves along with the inserted text.
The default is false.
Note that a cursor always moves when text is inserted before the current position of the cursor, and it always keeps its position when text is inserted after the current position of the cursor.
Definition at line 1415 of file qtextcursor.cpp.
void QTextCursor::setPosition | ( | int | pos, |
MoveMode | m = MoveAnchor |
||
) |
Moves the cursor to the absolute position in the document specified by pos using a MoveMode
specified by m.
The cursor is positioned between characters.
Definition at line 1165 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::activateLinkUnderCursor(), QTextControlPrivate::anchorForCursor(), QAccessibleTextWidget::attributes(), QTextControl::cursorForPosition(), QDeclarativeJS::TextWriter::doMove(), QDeclarativeJS::TextWriter::doReplace(), QTextControlPrivate::extendBlockwiseSelection(), QTextControlPrivate::extendWordwiseSelection(), QScriptEdit::extraAreaMouseEvent(), findInBlock(), QTextControl::findNextPrevAnchor(), QTextControlPrivate::inputMethodEvent(), QAccessibleTextWidget::insertText(), QDeclarativeTextEdit::moveCursorSelection(), QAccessibleTextEdit::pasteText(), QDeclarativeTextEdit::positionToRectangle(), QTextHtmlImporter::processBlockNode(), QTextDocument::redo(), QTextControlPrivate::repaintOldAndNewSelection(), QTextBrowserPrivate::restoreHistoryEntry(), QTextHtmlImporter::scanTable(), QAccessibleTextEdit::scrollToSubstring(), QDeclarativeTextEdit::select(), QAccessibleTextWidget::setCursorPosition(), QTextControlPrivate::setCursorPosition(), QDeclarativeTextEdit::setCursorPosition(), QAccessibleTextWidget::setSelection(), QLabel::setSelection(), QAccessibleTextWidget::text(), QAccessibleTextWidget::textCursorForRange(), QTextDocument::undo(), and QDeclarativeTextEditPrivate::updateSelection().
void QTextCursor::setVerticalMovementX | ( | int | x | ) |
Sets the visual x position for vertical cursor movements to x.
The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a visually straight line with proportional fonts, and to gently "jump" over short lines.
A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.
Definition at line 1355 of file qtextcursor.cpp.
void QTextCursor::setVisualNavigation | ( | bool | b | ) |
Sets visual navigation to b.
Visual navigation means skipping over hidden text pragraphs. The default is false.
Definition at line 1331 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::cursorMoveKeyEvent(), and QPlainTextEditPrivate::pageUpDown().
int QTextCursor::verticalMovementX | ( | ) | const |
Returns the visual x position for vertical cursor movements.
A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.
Definition at line 1373 of file qtextcursor.cpp.
bool QTextCursor::visualNavigation | ( | ) | const |
Returns true if the cursor does visual navigation; otherwise returns false.
Visual navigation means skipping over hidden text pragraphs. The default is false.
Definition at line 1313 of file qtextcursor.cpp.
Referenced by QTextControlPrivate::cursorMoveKeyEvent().
|
friend |
Definition at line 233 of file qtextcursor.h.
|
friend |
Definition at line 232 of file qtextcursor.h.
|
friend |
Definition at line 231 of file qtextcursor.h.
|
private |
Definition at line 230 of file qtextcursor.h.
Referenced by anchor(), atBlockEnd(), atBlockStart(), atEnd(), atStart(), beginEditBlock(), block(), blockCharFormat(), blockFormat(), blockNumber(), charFormat(), clearSelection(), columnNumber(), createList(), currentFrame(), currentList(), currentTable(), deleteChar(), deletePreviousChar(), document(), endEditBlock(), hasComplexSelection(), hasSelection(), QTextDocumentFragmentPrivate::insert(), insertBlock(), insertFragment(), insertFrame(), insertHtml(), insertImage(), insertTable(), insertText(), isCopyOf(), isNull(), joinPreviousEditBlock(), keepPositionOnInsert(), mergeBlockCharFormat(), mergeBlockFormat(), mergeCharFormat(), movePosition(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), position(), positionInBlock(), QTextCopyHelper::QTextCopyHelper(), QTextCursor(), QTextDocumentFragmentPrivate::QTextDocumentFragmentPrivate(), removeSelectedText(), select(), selectedTableCells(), selectedText(), selectionEnd(), selectionStart(), setBlockCharFormat(), setBlockFormat(), setCharFormat(), setKeepPositionOnInsert(), setPosition(), setVerticalMovementX(), setVisualNavigation(), verticalMovementX(), and visualNavigation().