ExtraSelection Struct struct QTextEdit::ExtraSelection. The QTextEdit::ExtraSelection structure provides a way of specifying a character format for a given selection in a document. More… This struct was introduced in Qt 4.2. List of all members, including inherited members Public Variables, QTextCursorExtraSelection::cursor. A cursor that contains a selection in a QTextDocument. QTextCharFormatExtraSelection::format. A format that is used to specify a foreground or background brush/color for the selection. ©2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
ExtraSelection. © 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
PySide2.QtWidgets. ExtraSelection .format¶ © 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
QTextCharFormat ExtraSelection:: format A format that is used to specify a foreground or background brush/color for the selection. © 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
QTextEdit_ExtraSelection: clone() This method is reimplemented for internal reasons QTextCursor: cursor() Returns the cursor of this QTextEdit_ExtraSelection. QTextCharFormat: format() Returns the format of this QTextEdit_ExtraSelection. void: setCursor(QTextCursor cursor) Sets this QTextEdit_ExtraSelection’s cursor. void: setFormat(QTextCharFormat format), List of All Members for ExtraSelection . Download. Start for Free. Qt for Application Development. Qt for Device Creation. Qt Open Source. Terms & Conditions. Licensing FAQ. Product.
The QTextEdit.ExtraSelection structure provides a way of specifying a character format for a given selection in a document. class PySide.QtGui.QTextEdit.ExtraSelection ¶. class PySide.QtGui.QTextEdit.ExtraSelection(ExtraSelection) Parameters: ExtraSelection PySide.QtGui.QTextEdit::ExtraSelection. PySide.QtGui.QTextEdit.ExtraSelection.cursor ¶.
Seems more like a Qt bug to me. If your just looking for a fix / workaround: Add this after tc.select(QTextCursor::Document): tc.setCharFormat(textCursor().charFormat()) That should sort the issue out. Details: This is the function I was testing this with.
def extraSelections(self): In normal mode – QTextEdit.ExtraSelection which highlightes the cursor if not isinstance(self._mode, Normal): return [] selection = QTextEdit.ExtraSelection() selection.format.setBackground(QColor(‘#ffcc22’)) selection.format.setForeground(QColor(‘#000000’)) selection.cursor = self._qpart.textCursor() selection.cursor.movePosition(QTextCursor.NextCharacter,