PythonQt.QtGui.QTextEdit · declarations 002
Back to PythonQt.QtGui.QTextEdit
fontItalic
fontItalic() -> bool
X.fontItalic() -> bool
Supplemental documentation: Qt 5 reference:
bool QTextEdit::fontItalic() const
Returns true if the font of the current format is italic; otherwise returns false.
See also setFontItalic().
Upstream PySide2 reference signatures (binding differences may apply):
fontItalic(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#fontItalic
fontPointSize
fontPointSize() -> float
X.fontPointSize() -> float
Supplemental documentation: Qt 5 reference:
qreal QTextEdit::fontPointSize() const
Returns the point size of the font of the current format.
See also setFontFamily(), setCurrentFont(), and setFontPointSize().
Upstream PySide2 reference signatures (binding differences may apply):
fontPointSize(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#fontPointSize
fontUnderline
fontUnderline() -> bool
X.fontUnderline() -> bool
Supplemental documentation: Qt 5 reference:
bool QTextEdit::fontUnderline() const
Returns true if the font of the current format is underlined; otherwise returns false.
See also setFontUnderline().
Upstream PySide2 reference signatures (binding differences may apply):
fontUnderline(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#fontUnderline
fontWeight
fontWeight() -> int
X.fontWeight() -> int
Supplemental documentation: Qt 5 reference:
int QTextEdit::fontWeight() const
Returns the font weight of the current format.
See also setFontWeight(), setCurrentFont(), setFontPointSize(), and QFont::Weight.
Upstream PySide2 reference signatures (binding differences may apply):
fontWeight(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#fontWeight
html
instance-attribute
html: Any
Qt 5 reference:
html : QString
This property provides an HTML interface to the text of the text edit.
toHtml() returns the text of the text edit as html.
setHtml() changes the text of the text edit. Any previous text is removed and the undo/redo history is cleared. The input text is interpreted as rich text in html format. currentCharFormat() is also reset, unless textCursor() is already at the beginning of the document.
Note: It is the responsibility of the caller to make sure that the text is correctly decoded when a QString containing HTML is created and passed to setHtml().
By default, for a newly-created, empty document, this property contains text to describe an HTML 4.0 document with no body text.
Access functions:
| QString | toHtml() const |
|---|---|
| void | setHtml(const QString \&text) |
Notifier signal:
| void | textChanged() |
|---|---|
See also Supported HTML Subset and plainText.
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#html
inputMethodEvent
inputMethodEvent(arg__1: Any) -> None
X.inputMethodEvent(arg__1)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::inputMethodEvent(QInputMethodEvent *e)
Reimplements: QWidget::inputMethodEvent(QInputMethodEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
inputMethodEvent(self, arg__1: PySide2.QtGui.QInputMethodEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#inputMethodEvent
inputMethodQuery
inputMethodQuery(property: Any) -> Any
X.inputMethodQuery(property) -> object
Supplemental documentation: Qt 5 reference:
[override virtual] QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
Reimplements: QWidget::inputMethodQuery(Qt::InputMethodQuery query) const.
Upstream PySide2 reference signatures (binding differences may apply):
inputMethodQuery(self, property: PySide2.QtCore.Qt.InputMethodQuery) -> typing.Any
inputMethodQuery(self, query: PySide2.QtCore.Qt.InputMethodQuery, argument: typing.Any) -> typing.Any
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#inputMethodQuery
insertFromMimeData
insertFromMimeData(source: Any) -> None
X.insertFromMimeData(source)
Supplemental documentation: Qt 5 reference:
[virtual protected] void QTextEdit::insertFromMimeData(const QMimeData *source)
This function inserts the contents of the MIME data object, specified by source, into the text edit at the current cursor position. It is called whenever text is inserted as the result of a clipboard paste operation, or when the text edit accepts data from a drag and drop operation.
Reimplement this function to enable drag and drop support for additional MIME types.
Upstream PySide2 reference signatures (binding differences may apply):
insertFromMimeData(self, source: PySide2.QtCore.QMimeData) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#insertFromMimeData
insertHtml
insertHtml(text: str) -> None
X.insertHtml(text)
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::insertHtml(const QString \&text)
Convenience slot that inserts text which is assumed to be of html formatting at the current cursor position.
It is equivalent to:
edit->textCursor().insertHtml(fragment);
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.
Upstream PySide2 reference signatures (binding differences may apply):
insertHtml(self, text: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#insertHtml
insertPlainText
insertPlainText(text: str) -> None
X.insertPlainText(text)
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::insertPlainText(const QString \&text)
Convenience slot that inserts text at the current cursor position.
It is equivalent to
edit->textCursor().insertText(text);
Upstream PySide2 reference signatures (binding differences may apply):
insertPlainText(self, text: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#insertPlainText
isReadOnly
isReadOnly() -> bool
X.isReadOnly() -> bool
Upstream PySide2 reference signatures (binding differences may apply):
isReadOnly(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#isReadOnly
isUndoRedoEnabled
isUndoRedoEnabled() -> bool
X.isUndoRedoEnabled() -> bool
Upstream PySide2 reference signatures (binding differences may apply):
isUndoRedoEnabled(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#isUndoRedoEnabled
keyPressEvent
keyPressEvent(e: Any) -> None
X.keyPressEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::keyPressEvent(QKeyEvent *e)
Reimplements: QAbstractScrollArea::keyPressEvent(QKeyEvent *e).
Upstream PySide2 reference signatures (binding differences may apply):
keyPressEvent(self, e: PySide2.QtGui.QKeyEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#keyPressEvent
keyReleaseEvent
keyReleaseEvent(e: Any) -> None
X.keyReleaseEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::keyReleaseEvent(QKeyEvent *e)
Reimplements: QWidget::keyReleaseEvent(QKeyEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
keyReleaseEvent(self, e: PySide2.QtGui.QKeyEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#keyReleaseEvent
lineWrapColumnOrWidth
instance-attribute
lineWrapColumnOrWidth: int
Qt 5 reference:
lineWrapColumnOrWidth : int
This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped
If the wrap mode is FixedPixelWidth, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is FixedColumnWidth, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.
By default, this property contains a value of 0.
Access functions:
| int | lineWrapColumnOrWidth() const |
|---|---|
| void | setLineWrapColumnOrWidth(int w) |
See also lineWrapMode.
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#lineWrapColumnOrWidth
lineWrapMode
instance-attribute
lineWrapMode: Any
Qt 5 reference:
lineWrapMode : LineWrapMode
This property holds the line wrap mode
The default mode is WidgetWidth which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use setWordWrapMode(). If you set a wrap mode of FixedPixelWidth or FixedColumnWidth you should also call setLineWrapColumnOrWidth() with the width you want.
Access functions:
| QTextEdit::LineWrapMode | lineWrapMode() const |
|---|---|
| void | setLineWrapMode(QTextEdit::LineWrapMode mode) |
See also lineWrapColumnOrWidth.
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#lineWrapMode
loadResource
loadResource(type: int, name: Any) -> Any
X.loadResource(type, name) -> object
Supplemental documentation: Qt 5 reference:
[virtual] QVariant QTextEdit::loadResource(int type, const QUrl \&name)
Loads the resource specified by the given type and name.
This function is an extension of QTextDocument::loadResource().
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also QTextDocument::loadResource().
Upstream PySide2 reference signatures (binding differences may apply):
loadResource(self, type: int, name: PySide2.QtCore.QUrl) -> typing.Any
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#loadResource
markdown
instance-attribute
markdown: Any
Qt 5 reference:
markdown : QString
This property provides a Markdown interface to the text of the text edit.
toMarkdown() returns the text of the text edit as "pure" Markdown, without any
embedded HTML formatting. Some features that
QTextDocument supports (such as
the use of specific colors and named fonts) cannot be expressed in "pure" Markdown, and
they will be omitted.
setMarkdown() changes the text of the text edit. Any previous text is removed and the
undo/redo history is cleared. The input text is interpreted as rich text in Markdown
format.
Parsing of HTML included in the markdown string is handled in the same way as in setHtml; however, Markdown formatting inside HTML blocks is not supported.
Some features of the parser can be enabled or disabled via the features argument:
| Constant | Description |
|---|---|
MarkdownNoHTML |
Any HTML tags in the Markdown text will be discarded |
MarkdownDialectCommonMark |
The parser supports only the features standardized by CommonMark |
MarkdownDialectGitHub |
The parser supports the GitHub dialect |
The default is MarkdownDialectGitHub.
This property was introduced in Qt 5.14.
Access functions:
| QString | toMarkdown(QTextDocument::MarkdownFeatures features \= QTextDocument::MarkdownDialectGitHub) const |
|---|---|
| void | setMarkdown(const QString \&markdown) |
Notifier signal:
| void | textChanged() |
|---|---|
See also plainText, html, QTextDocument::toMarkdown(), and QTextDocument::setMarkdown().
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#markdown
mergeCurrentCharFormat
mergeCurrentCharFormat(modifier: Any) -> None
X.mergeCurrentCharFormat(modifier)
Supplemental documentation: Qt 5 reference:
void QTextEdit::mergeCurrentCharFormat(const QTextCharFormat \&modifier)
Merges the properties specified in modifier into the current character format by calling QTextCursor::mergeCharFormat on the editor's cursor. If the editor has a selection then the properties of modifier are directly applied to the selection.
See also QTextCursor::mergeCharFormat().
Upstream PySide2 reference signatures (binding differences may apply):
mergeCurrentCharFormat(self, modifier: PySide2.QtGui.QTextCharFormat) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#mergeCurrentCharFormat
mouseDoubleClickEvent
mouseDoubleClickEvent(e: Any) -> None
X.mouseDoubleClickEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
Reimplements: QAbstractScrollArea::mouseDoubleClickEvent(QMouseEvent *e).
Upstream PySide2 reference signatures (binding differences may apply):
mouseDoubleClickEvent(self, e: PySide2.QtGui.QMouseEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#mouseDoubleClickEvent
mouseMoveEvent
mouseMoveEvent(e: Any) -> None
X.mouseMoveEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::mouseMoveEvent(QMouseEvent *e)
Reimplements: QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e).
Upstream PySide2 reference signatures (binding differences may apply):
mouseMoveEvent(self, e: PySide2.QtGui.QMouseEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#mouseMoveEvent
mousePressEvent
mousePressEvent(e: Any) -> None
X.mousePressEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::mousePressEvent(QMouseEvent *e)
Reimplements: QAbstractScrollArea::mousePressEvent(QMouseEvent *e).
Upstream PySide2 reference signatures (binding differences may apply):
mousePressEvent(self, e: PySide2.QtGui.QMouseEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#mousePressEvent
mouseReleaseEvent
mouseReleaseEvent(e: Any) -> None
X.mouseReleaseEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::mouseReleaseEvent(QMouseEvent *e)
Reimplements: QAbstractScrollArea::mouseReleaseEvent(QMouseEvent *e).
Upstream PySide2 reference signatures (binding differences may apply):
mouseReleaseEvent(self, e: PySide2.QtGui.QMouseEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#mouseReleaseEvent
moveCursor
moveCursor(operation: Any, mode: Any) -> None
X.moveCursor(operation, mode)
Supplemental documentation: Qt 5 reference:
void QTextEdit::moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode \= QTextCursor::MoveAnchor)
Moves the cursor by performing the given operation.
If mode is QTextCursor::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.
This function was introduced in Qt 4.2.
See also QTextCursor::movePosition().
Upstream PySide2 reference signatures (binding differences may apply):
moveCursor(self, operation: PySide2.QtGui.QTextCursor.MoveOperation, mode: PySide2.QtGui.QTextCursor.MoveMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#moveCursor
objectNameChanged
objectNameChanged(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QTextEdit.objectNameChanged; argument details are not documented.
overwriteMode
instance-attribute
overwriteMode: bool
Qt 5 reference:
overwriteMode : bool
This property holds whether text entered by the user will overwrite existing text
As with many text editors, the text editor widget can be configured to insert or overwrite existing text with new text entered by the user.
If this property is true, existing text is overwritten, character-for-character by new
text; otherwise, text is inserted at the cursor position, displacing existing text.
By default, this property is false (new text does not overwrite existing text).
This property was introduced in Qt 4.1.
Access functions:
| bool | overwriteMode() const |
|---|---|
| void | setOverwriteMode(bool overwrite) |
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#overwriteMode
paintEvent
paintEvent(e: Any) -> None
X.paintEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::paintEvent(QPaintEvent *event)
Reimplements: QAbstractScrollArea::paintEvent(QPaintEvent *event).
This event handler can be reimplemented in a subclass to receive paint events passed in event. It is usually unnecessary to reimplement this function in a subclass of QTextEdit.
Warning: The underlying text document must not be modified from within a reimplementation of this function.
Upstream PySide2 reference signatures (binding differences may apply):
paintEvent(self, e: PySide2.QtGui.QPaintEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#paintEvent
paste
paste() -> None
X.paste()
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::paste()
Pastes the text from the clipboard into the text edit at the current cursor position.
If there is no text in the clipboard nothing happens.
To change the behavior of this function, i.e. to modify what QTextEdit can paste and how it is being pasted, reimplement the virtual canInsertFromMimeData() and insertFromMimeData() functions.
Upstream PySide2 reference signatures (binding differences may apply):
paste(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#paste
placeholderText
instance-attribute
placeholderText: str
Qt 5 reference:
placeholderText : QString
This property holds the editor placeholder text
Setting this property makes the editor display a grayed-out placeholder text as long as the document() is empty.
By default, this property contains an empty string.
This property was introduced in Qt 5.2.
Access functions:
| QString | placeholderText() const |
|---|---|
| void | setPlaceholderText(const QString \&placeholderText) |
See also document().
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#placeholderText
plainText
instance-attribute
plainText: Any
Qt 5 reference:
plainText : QString
This property gets and sets the text editor's contents as plain text. Previous contents are removed and undo/redo history is reset when the property is set. currentCharFormat() is also reset, unless textCursor() is already at the beginning of the document.
If the text edit has another content type, it will not be replaced by plain text if you call toPlainText(). The only exception to this is the non-break space, nbsp;, that will be converted into standard space.
By default, for an editor with no contents, this property contains an empty string.
This property was introduced in Qt 4.3.
Access functions:
| QString | toPlainText() const |
|---|---|
| void | setPlainText(const QString \&text) |
See also html.
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#plainText
print(printer: Any) -> Any
X.print(printer)
Supplemental documentation: Qt 5 reference:
void QTextEdit::print(QPagedPaintDevice *printer) const
Convenience function to print the text edit's document to the given printer. This is equivalent to calling the print method on the document directly except that this function also supports QPrinter::Selection as print range.
This function was introduced in Qt 4.3.
See also QTextDocument::print().
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#print
readOnly
instance-attribute
readOnly: Any
Qt 5 reference:
readOnly : bool
This property holds whether the text edit is read-only
In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.
This property's default is false.
Access functions:
| bool | isReadOnly() const |
|---|---|
| void | setReadOnly(bool ro) |
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#readOnly
redo
redo() -> None
X.redo()
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::redo()
Redoes the last operation.
If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.
This function was introduced in Qt 4.2.
See also undo().
Upstream PySide2 reference signatures (binding differences may apply):
redo(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#redo
redoAvailable
redoAvailable(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QTextEdit.redoAvailable; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QTextEdit::redoAvailable(bool available)
This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#redoAvailable
resizeEvent
resizeEvent(e: Any) -> None
X.resizeEvent(e)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::resizeEvent(QResizeEvent *e)
Reimplements: QAbstractScrollArea::resizeEvent(QResizeEvent *event).
Upstream PySide2 reference signatures (binding differences may apply):
resizeEvent(self, e: PySide2.QtGui.QResizeEvent) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#resizeEvent
scrollContentsBy
scrollContentsBy(dx: int, dy: int) -> None
X.scrollContentsBy(dx, dy)
Supplemental documentation: Qt 5 reference:
[override virtual protected] void QTextEdit::scrollContentsBy(int dx, int dy)
Reimplements: QAbstractScrollArea::scrollContentsBy(int dx, int dy).
Upstream PySide2 reference signatures (binding differences may apply):
scrollContentsBy(self, dx: int, dy: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#scrollContentsBy
scrollToAnchor
scrollToAnchor(name: str) -> None
X.scrollToAnchor(name)
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::scrollToAnchor(const QString \&name)
Scrolls the text edit so that the anchor with the given name is visible; does nothing if the name is empty, or is already visible, or isn't found.
Upstream PySide2 reference signatures (binding differences may apply):
scrollToAnchor(self, name: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#scrollToAnchor
selectAll
selectAll() -> None
X.selectAll()
Supplemental documentation: Qt 5 reference:
[slot] void QTextEdit::selectAll()
Selects all text.
See also copy(), cut(), and textCursor().
Upstream PySide2 reference signatures (binding differences may apply):
selectAll(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#selectAll
selectionChanged
selectionChanged(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtGui.QTextEdit.selectionChanged; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QTextEdit::selectionChanged()
This signal is emitted whenever the selection changes.
See also copyAvailable().
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#selectionChanged
setAcceptRichText
setAcceptRichText(accept: bool) -> None
X.setAcceptRichText(accept)
Upstream PySide2 reference signatures (binding differences may apply):
setAcceptRichText(self, accept: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#setAcceptRichText