Skip to content

PythonQt.QtGui.QTextCursor · declarations 002

Back to PythonQt.QtGui.QTextCursor

clearSelection

clearSelection() -> None

X.clearSelection()

Supplemental documentation: Qt 5 reference:

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.

See also removeSelectedText() and hasSelection().

Upstream PySide2 reference signatures (binding differences may apply):

clearSelection(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#clearSelection

columnNumber

columnNumber() -> int

X.columnNumber() -> int

Supplemental documentation: Qt 5 reference:

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.

This function was introduced in Qt 4.2.

See also positionInBlock().

Upstream PySide2 reference signatures (binding differences may apply):

columnNumber(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#columnNumber

createList

createList(style: Any) -> Any

X.createList(style) -> PythonQt.QtGui.QTextList

Supplemental documentation: Qt 5 reference:

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.

See also insertList() and currentList().

QTextList *QTextCursor::createList(QTextListFormat::Style style)

This is an overloaded function.

Creates and returns a new list with the given style, making the cursor's current paragraph the first list item.

The style to be used is defined by the QTextListFormat::Style enum.

See also insertList() and currentList().

Upstream PySide2 reference signatures (binding differences may apply):

createList(self, format: PySide2.QtGui.QTextListFormat) -> PySide2.QtGui.QTextList
createList(self, style: PySide2.QtGui.QTextListFormat.Style) -> PySide2.QtGui.QTextList

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#createList

currentFrame

currentFrame() -> Any

X.currentFrame() -> PythonQt.QtGui.QTextFrame

Supplemental documentation: Qt 5 reference:

QTextFrame *QTextCursor::currentFrame() const

Returns a pointer to the current frame. Returns nullptr if the cursor is invalid.

See also insertFrame().

Upstream PySide2 reference signatures (binding differences may apply):

currentFrame(self) -> PySide2.QtGui.QTextFrame

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#currentFrame

currentList

currentList() -> Any

X.currentList() -> PythonQt.QtGui.QTextList

Supplemental documentation: Qt 5 reference:

QTextList *QTextCursor::currentList() const

Returns the current list if the cursor position() is inside a block that is part of a list; otherwise returns nullptr.

See also insertList() and createList().

Upstream PySide2 reference signatures (binding differences may apply):

currentList(self) -> PySide2.QtGui.QTextList

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#currentList

currentTable

currentTable() -> Any

X.currentTable() -> PythonQt.QtGui.QTextTable

Supplemental documentation: Qt 5 reference:

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 nullptr.

See also insertTable().

Upstream PySide2 reference signatures (binding differences may apply):

currentTable(self) -> PySide2.QtGui.QTextTable

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#currentTable

deleteChar

deleteChar() -> None

X.deleteChar()

Supplemental documentation: Qt 5 reference:

void QTextCursor::deleteChar()

If there is no selected text, deletes the character at the current cursor position; otherwise deletes the selected text.

See also deletePreviousChar(), hasSelection(), and clearSelection().

Upstream PySide2 reference signatures (binding differences may apply):

deleteChar(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#deleteChar

deletePreviousChar

deletePreviousChar() -> None

X.deletePreviousChar()

Supplemental documentation: Qt 5 reference:

void QTextCursor::deletePreviousChar()

If there is no selected text, deletes the character before the current cursor position; otherwise deletes the selected text.

See also deleteChar(), hasSelection(), and clearSelection().

Upstream PySide2 reference signatures (binding differences may apply):

deletePreviousChar(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#deletePreviousChar

document

document() -> Any

X.document() -> PythonQt.QtGui.QTextDocument

Supplemental documentation: Qt 5 reference:

QTextDocument *QTextCursor::document() const

Returns the document this cursor is associated with.

This function was introduced in Qt 4.5.

Upstream PySide2 reference signatures (binding differences may apply):

document(self) -> PySide2.QtGui.QTextDocument

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#document

endEditBlock

endEditBlock() -> None

X.endEditBlock()

Supplemental documentation: Qt 5 reference:

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.

See also beginEditBlock().

Upstream PySide2 reference signatures (binding differences may apply):

endEditBlock(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#endEditBlock

hasComplexSelection

hasComplexSelection() -> bool

X.hasComplexSelection() -> bool

Supplemental documentation: Qt 5 reference:

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().

Upstream PySide2 reference signatures (binding differences may apply):

hasComplexSelection(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#hasComplexSelection

hasSelection

hasSelection() -> bool

X.hasSelection() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextCursor::hasSelection() const

Returns true if the cursor contains a selection; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

hasSelection(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#hasSelection

insertBlock

insertBlock(format: Any, charFormat: Any) -> None

X.insertBlock(format, charFormat)

Supplemental documentation: Qt 5 reference:

void QTextCursor::insertBlock()

Inserts a new empty block at the cursor position() with the current blockFormat() and charFormat().

See also setBlockFormat().

void QTextCursor::insertBlock(const QTextBlockFormat \&format)

This is an overloaded function.

Inserts a new empty block at the cursor position() with block format format and the current charFormat() as block char format.

See also setBlockFormat().

void QTextCursor::insertBlock(const QTextBlockFormat \&format, const QTextCharFormat \&charFormat)

This is an overloaded function.

Inserts a new empty block at the cursor position() with block format format and charFormat as block char format.

See also setBlockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

insertBlock(self) -> None
insertBlock(self, format: PySide2.QtGui.QTextBlockFormat) -> None
insertBlock(self, format: PySide2.QtGui.QTextBlockFormat, charFormat: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertBlock

insertFragment

insertFragment(fragment: Any) -> None

X.insertFragment(fragment)

Supplemental documentation: Qt 5 reference:

void QTextCursor::insertFragment(const QTextDocumentFragment \&fragment)

Inserts the text fragment at the current position().

Upstream PySide2 reference signatures (binding differences may apply):

insertFragment(self, fragment: PySide2.QtGui.QTextDocumentFragment) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertFragment

insertFrame

insertFrame(format: Any) -> Any

X.insertFrame(format) -> PythonQt.QtGui.QTextFrame

Supplemental documentation: Qt 5 reference:

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.

See also hasSelection().

Upstream PySide2 reference signatures (binding differences may apply):

insertFrame(self, format: PySide2.QtGui.QTextFrameFormat) -> PySide2.QtGui.QTextFrame

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertFrame

insertHtml

insertHtml(html: str) -> None

X.insertHtml(html)

Supplemental documentation: Qt 5 reference:

void QTextCursor::insertHtml(const QString \&html)

Inserts the text html at the current position(). The text is interpreted as HTML.

Note: When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use QTextDocument::setDefaultStyleSheet() instead.

This function was introduced in Qt 4.2.

Upstream PySide2 reference signatures (binding differences may apply):

insertHtml(self, html: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertHtml

insertImage

insertImage(image: Any, name: Any) -> None

X.insertImage(image, name)

Supplemental documentation: Qt 5 reference:

void QTextCursor::insertImage(const QTextImageFormat \&format)

Inserts the image defined by format at the current position().

void QTextCursor::insertImage(const QTextImageFormat \&format, QTextFrameFormat::Position alignment)

This is an overloaded function.

Inserts the image defined by the given format at the cursor's current position with the specified alignment.

This function was introduced in Qt 4.2.

See also position().

void QTextCursor::insertImage(const QString \&name)

This is an overloaded function.

Convenience method for inserting the image with the given name at the current position().

QImage img = ...
textDocument->addResource(QTextDocument::ImageResource, QUrl("myimage"), img);
cursor.insertImage("myimage");

void QTextCursor::insertImage(const QImage \&image, const QString \&name \= QString())

This is an overloaded function.

Convenience function for inserting the given image with an optional name at the current position().

This function was introduced in Qt 4.5.

Upstream PySide2 reference signatures (binding differences may apply):

insertImage(self, format: PySide2.QtGui.QTextImageFormat) -> None
insertImage(self, format: PySide2.QtGui.QTextImageFormat, alignment: PySide2.QtGui.QTextFrameFormat.Position) -> None
insertImage(self, image: PySide2.QtGui.QImage, name: str=...) -> None
insertImage(self, name: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertImage

insertList

insertList(style: Any) -> Any

X.insertList(style) -> PythonQt.QtGui.QTextList

Supplemental documentation: Qt 5 reference:

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.

See also currentList(), createList(), and insertBlock().

QTextList *QTextCursor::insertList(QTextListFormat::Style style)

This is an overloaded function.

Inserts a new block at the current position and makes it the first list item of a newly created list with the given style. Returns the created list.

See also currentList(), createList(), and insertBlock().

Upstream PySide2 reference signatures (binding differences may apply):

insertList(self, format: PySide2.QtGui.QTextListFormat) -> PySide2.QtGui.QTextList
insertList(self, style: PySide2.QtGui.QTextListFormat.Style) -> PySide2.QtGui.QTextList

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertList

insertTable

insertTable(rows: int, cols: int, format: Any) -> Any

X.insertTable(rows, cols, format) -> PythonQt.QtGui.QTextTable

Supplemental documentation: Qt 5 reference:

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.

See also currentTable().

QTextTable *QTextCursor::insertTable(int rows, int columns)

This is an overloaded function.

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.

See also currentTable().

Upstream PySide2 reference signatures (binding differences may apply):

insertTable(self, rows: int, cols: int) -> PySide2.QtGui.QTextTable
insertTable(self, rows: int, cols: int, format: PySide2.QtGui.QTextTableFormat) -> PySide2.QtGui.QTextTable

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertTable

insertText

insertText(text: str, format: Any) -> None

X.insertText(text, format)

Supplemental documentation: Qt 5 reference:

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:

cursor.clearSelection();
cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor);
cursor.insertText("Hello World");

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.

See also charFormat() and hasSelection().

void QTextCursor::insertText(const QString \&text, const QTextCharFormat \&format)

This is an overloaded function.

Inserts text at the current position with the given format.

Upstream PySide2 reference signatures (binding differences may apply):

insertText(self, text: str) -> None
insertText(self, text: str, format: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#insertText

isCopyOf

isCopyOf(other: Any) -> bool

X.isCopyOf(other) -> bool

Supplemental documentation: Qt 5 reference:

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.

See also operator\=() and operator\=\=().

Upstream PySide2 reference signatures (binding differences may apply):

isCopyOf(self, other: PySide2.QtGui.QTextCursor) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#isCopyOf

isNull

isNull() -> bool

X.isNull() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextCursor::isNull() const

Returns true if the cursor is null; otherwise returns false. A null cursor is created by the default constructor.

Upstream PySide2 reference signatures (binding differences may apply):

isNull(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#isNull

joinPreviousEditBlock

joinPreviousEditBlock() -> None

X.joinPreviousEditBlock()

Supplemental documentation: Qt 5 reference:

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:

QTextCursor cursor(textDocument);
cursor.beginEditBlock();
cursor.insertText("Hello");
cursor.insertText("World");
cursor.endEditBlock();

...

cursor.joinPreviousEditBlock();
cursor.insertText("Hey");
cursor.endEditBlock();

textDocument->undo();

The call to undo() will cause all three insertions to be undone.

See also beginEditBlock() and endEditBlock().

Upstream PySide2 reference signatures (binding differences may apply):

joinPreviousEditBlock(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#joinPreviousEditBlock

keepPositionOnInsert

keepPositionOnInsert() -> bool

X.keepPositionOnInsert() -> bool

Supplemental documentation: Qt 5 reference:

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;

This function was introduced in Qt 4.7.

See also setKeepPositionOnInsert().

Upstream PySide2 reference signatures (binding differences may apply):

keepPositionOnInsert(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#keepPositionOnInsert

mergeBlockCharFormat

mergeBlockCharFormat(modifier: Any) -> None

X.mergeBlockCharFormat(modifier)

Supplemental documentation: Qt 5 reference:

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.

See also setBlockCharFormat().

Upstream PySide2 reference signatures (binding differences may apply):

mergeBlockCharFormat(self, modifier: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#mergeBlockCharFormat

mergeBlockFormat

mergeBlockFormat(modifier: Any) -> None

X.mergeBlockFormat(modifier)

Supplemental documentation: Qt 5 reference:

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.

See also setBlockFormat() and blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

mergeBlockFormat(self, modifier: PySide2.QtGui.QTextBlockFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#mergeBlockFormat

mergeCharFormat

mergeCharFormat(modifier: Any) -> None

X.mergeCharFormat(modifier)

Supplemental documentation: Qt 5 reference:

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.

See also hasSelection() and setCharFormat().

Upstream PySide2 reference signatures (binding differences may apply):

mergeCharFormat(self, modifier: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#mergeCharFormat

movePosition

movePosition(op: Any, arg__2: Any, n: int) -> bool

X.movePosition(op, arg__2, n) -> bool

Supplemental documentation: Qt 5 reference:

bool QTextCursor::movePosition(QTextCursor::MoveOperation operation, QTextCursor::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.

See also setVisualNavigation().

Upstream PySide2 reference signatures (binding differences may apply):

movePosition(self, op: PySide2.QtGui.QTextCursor.MoveOperation, arg__2: PySide2.QtGui.QTextCursor.MoveMode=..., n: int=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#movePosition

position

position() -> int

X.position() -> int

Supplemental documentation: Qt 5 reference:

int QTextCursor::position() const

Returns the absolute position of the cursor within the document. The cursor is positioned between characters.

Note: The "characters" in this case refer to the string of QChar objects, i.e. 16-bit Unicode characters, and the position is considered an index into this string. This does not necessarily correspond to individual graphemes in the writing system, as a single grapheme may be represented by multiple Unicode characters, such as in the case of surrogate pairs, linguistic ligatures or diacritics.

See also setPosition(), movePosition(), anchor(), and positionInBlock().

Upstream PySide2 reference signatures (binding differences may apply):

position(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#position

positionInBlock

positionInBlock() -> int

X.positionInBlock() -> int

Supplemental documentation: Qt 5 reference:

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().

Note: The "characters" in this case refer to the string of QChar objects, i.e. 16-bit Unicode characters, and the position is considered an index into this string. This does not necessarily correspond to individual graphemes in the writing system, as a single grapheme may be represented by multiple Unicode characters, such as in the case of surrogate pairs, linguistic ligatures or diacritics.

This function was introduced in Qt 4.7.

See also position().

Upstream PySide2 reference signatures (binding differences may apply):

positionInBlock(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#positionInBlock

removeSelectedText

removeSelectedText() -> None

X.removeSelectedText()

Supplemental documentation: Qt 5 reference:

void QTextCursor::removeSelectedText()

If there is a selection, its content is deleted; otherwise does nothing.

See also hasSelection().

Upstream PySide2 reference signatures (binding differences may apply):

removeSelectedText(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#removeSelectedText

select

select(selection: Any) -> None

X.select(selection)

Supplemental documentation: Qt 5 reference:

void QTextCursor::select(QTextCursor::SelectionType selection)

Selects text in the document according to the given selection.

Upstream PySide2 reference signatures (binding differences may apply):

select(self, selection: PySide2.QtGui.QTextCursor.SelectionType) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#select

selectedText

selectedText() -> str

X.selectedText() -> str

Supplemental documentation: Qt 5 reference:

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.

Note: If the selection obtained from an editor spans a line break, the text will contain a Unicode U+2029 paragraph separator character instead of a newline \n character. Use QString::replace() to replace these characters with newlines.

Upstream PySide2 reference signatures (binding differences may apply):

selectedText(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#selectedText

selection

selection() -> Any

X.selection() -> PythonQt.QtGui.QTextDocumentFragment

Supplemental documentation: Qt 5 reference:

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.

Note: Unlike QTextDocumentFragment::toPlainText(), selectedText() may include special unicode characters such as QChar::ParagraphSeparator.

See also QTextDocumentFragment::toPlainText().

Upstream PySide2 reference signatures (binding differences may apply):

selection(self) -> PySide2.QtGui.QTextDocumentFragment

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#selection

selectionEnd

selectionEnd() -> int

X.selectionEnd() -> int

Supplemental documentation: Qt 5 reference:

int QTextCursor::selectionEnd() const

Returns the end of the selection or position() if the cursor doesn't have a selection.

See also selectionStart(), position(), and anchor().

Upstream PySide2 reference signatures (binding differences may apply):

selectionEnd(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#selectionEnd

selectionStart

selectionStart() -> int

X.selectionStart() -> int

Supplemental documentation: Qt 5 reference:

int QTextCursor::selectionStart() const

Returns the start of the selection or position() if the cursor doesn't have a selection.

See also selectionEnd(), position(), and anchor().

Upstream PySide2 reference signatures (binding differences may apply):

selectionStart(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#selectionStart

setBlockCharFormat

setBlockCharFormat(format: Any) -> None

X.setBlockCharFormat(format)

Supplemental documentation: Qt 5 reference:

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.

See also blockCharFormat().

Upstream PySide2 reference signatures (binding differences may apply):

setBlockCharFormat(self, format: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setBlockCharFormat

setBlockFormat

setBlockFormat(format: Any) -> None

X.setBlockFormat(format)

Supplemental documentation: Qt 5 reference:

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.

See also blockFormat() and mergeBlockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

setBlockFormat(self, format: PySide2.QtGui.QTextBlockFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setBlockFormat

setCharFormat

setCharFormat(format: Any) -> None

X.setCharFormat(format)

Supplemental documentation: Qt 5 reference:

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.

See also charFormat(), hasSelection(), and mergeCharFormat().

Upstream PySide2 reference signatures (binding differences may apply):

setCharFormat(self, format: PySide2.QtGui.QTextCharFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setCharFormat

setKeepPositionOnInsert

setKeepPositionOnInsert(b: bool) -> None

X.setKeepPositionOnInsert(b)

Supplemental documentation: Qt 5 reference:

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.

This function was introduced in Qt 4.7.

See also keepPositionOnInsert().

Upstream PySide2 reference signatures (binding differences may apply):

setKeepPositionOnInsert(self, b: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setKeepPositionOnInsert