Skip to content

PythonQt.QtGui.QPlainTextEdit · declarations 002

Back to PythonQt.QtGui.QPlainTextEdit

extraSelections

extraSelections() -> tuple

X.extraSelections() -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QTextEdit::ExtraSelection> QPlainTextEdit::extraSelections() const

Returns previously set extra selections.

See also setExtraSelections().

Upstream PySide2 reference signatures (binding differences may apply):

extraSelections(self) -> typing.List[PySide2.QtWidgets.QTextEdit.ExtraSelection]

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#extraSelections

find

find(exp: Any, options: Any) -> bool

X.find(exp, options) -> bool

Supplemental documentation: Qt 5 reference:

bool QPlainTextEdit::find(const QString \&exp, QTextDocument::FindFlags options \= QTextDocument::FindFlags())

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

bool QPlainTextEdit::find(const QRegExp \&exp, QTextDocument::FindFlags options \= QTextDocument::FindFlags())

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options. The QTextDocument::FindCaseSensitively option is ignored for this overload, use QRegExp::caseSensitivity instead.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

This function was introduced in Qt 5.3.

bool QPlainTextEdit::find(const QRegularExpression \&exp, QTextDocument::FindFlags options \= QTextDocument::FindFlags())

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

Warning: For historical reasons, the case sensitivity option set on exp is ignored. Instead, the options are used to determine if the search is case sensitive or not.

This function was introduced in Qt 5.13.

Upstream PySide2 reference signatures (binding differences may apply):

find(self, exp: PySide2.QtCore.QRegExp, options: PySide2.QtGui.QTextDocument.FindFlags=...) -> bool
find(self, exp: PySide2.QtCore.QRegularExpression, options: PySide2.QtGui.QTextDocument.FindFlags=...) -> bool
find(self, exp: str, options: PySide2.QtGui.QTextDocument.FindFlags=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#find

firstVisibleBlock

firstVisibleBlock() -> Any

X.firstVisibleBlock() -> PythonQt.QtGui.QTextBlock

Supplemental documentation: Qt 5 reference:

[protected] QTextBlock QPlainTextEdit::firstVisibleBlock() const

Returns the first visible block.

See also blockBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

firstVisibleBlock(self) -> PySide2.QtGui.QTextBlock

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#firstVisibleBlock

focusInEvent

focusInEvent(e: Any) -> None

X.focusInEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::focusInEvent(QFocusEvent *e)

Reimplements: QWidget::focusInEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusInEvent(self, e: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#focusInEvent

focusNextPrevChild

focusNextPrevChild(next: bool) -> bool

X.focusNextPrevChild(next) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QPlainTextEdit::focusNextPrevChild(bool next)

Reimplements: QWidget::focusNextPrevChild(bool next).

Upstream PySide2 reference signatures (binding differences may apply):

focusNextPrevChild(self, next: bool) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#focusNextPrevChild

focusOutEvent

focusOutEvent(e: Any) -> None

X.focusOutEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::focusOutEvent(QFocusEvent *e)

Reimplements: QWidget::focusOutEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusOutEvent(self, e: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#focusOutEvent

getPaintContext

getPaintContext() -> Any

X.getPaintContext() -> PythonQt.QtGui.QAbstractTextDocumentLayout::PaintContext

Supplemental documentation: Qt 5 reference:

[protected] QAbstractTextDocumentLayout::PaintContext QPlainTextEdit::getPaintContext() const

Returns the paint context for the viewport(), useful only when reimplementing paintEvent().

Upstream PySide2 reference signatures (binding differences may apply):

getPaintContext(self) -> PySide2.QtGui.QAbstractTextDocumentLayout.PaintContext

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#getPaintContext

inputMethodEvent

inputMethodEvent(arg__1: Any) -> None

X.inputMethodEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#inputMethodEvent

inputMethodQuery

inputMethodQuery(property: Any) -> Any

X.inputMethodQuery(property) -> object

Supplemental documentation: Qt 5 reference:

[override virtual] QVariant QPlainTextEdit::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/qplaintextedit.html#inputMethodQuery

insertFromMimeData

insertFromMimeData(source: Any) -> None

X.insertFromMimeData(source)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QPlainTextEdit::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.

Upstream PySide2 reference signatures (binding differences may apply):

insertFromMimeData(self, source: PySide2.QtCore.QMimeData) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#insertFromMimeData

insertPlainText

insertPlainText(text: str) -> None

X.insertPlainText(text)

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::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/qplaintextedit.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/qplaintextedit.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/qplaintextedit.html#isUndoRedoEnabled

keyPressEvent

keyPressEvent(e: Any) -> None

X.keyPressEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#keyPressEvent

keyReleaseEvent

keyReleaseEvent(e: Any) -> None

X.keyReleaseEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#keyReleaseEvent

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

Access functions:

QPlainTextEdit::LineWrapMode lineWrapMode() const
void setLineWrapMode(QPlainTextEdit::LineWrapMode mode)

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#lineWrapMode

loadResource

loadResource(type: int, name: Any) -> Any

X.loadResource(type, name) -> object

Supplemental documentation: Qt 5 reference:

[virtual] QVariant QPlainTextEdit::loadResource(int type, const QUrl \&name)

Loads the resource specified by the given type and name.

This function is an extension of QTextDocument::loadResource().

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/qplaintextedit.html#loadResource

maximumBlockCount instance-attribute

maximumBlockCount: int

Qt 5 reference:

maximumBlockCount : int

This property holds the limit for blocks in the document.

Specifies the maximum number of blocks the document may have. If there are more blocks in the document that specified with this property blocks are removed from the beginning of the document.

A negative or zero value specifies that the document may contain an unlimited amount of blocks.

The default value is 0.

Note that setting this property will apply the limit immediately to the document contents. Setting this property also disables the undo redo history.

Access functions:

int maximumBlockCount() const
void setMaximumBlockCount(int maximum)

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#maximumBlockCount

mergeCurrentCharFormat

mergeCurrentCharFormat(modifier: Any) -> None

X.mergeCurrentCharFormat(modifier)

Supplemental documentation: Qt 5 reference:

void QPlainTextEdit::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/qplaintextedit.html#mergeCurrentCharFormat

modificationChanged

modificationChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPlainTextEdit.modificationChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::modificationChanged(bool changed)

This signal is emitted whenever the content of the document changes in a way that affects the modification state. If changed is true, the document has been modified; otherwise it is false.

For example, calling setModified(false) on a document and then inserting text causes the signal to get emitted. If you undo that operation, causing the document to return to its original unmodified state, the signal will get emitted again.

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#modificationChanged

mouseDoubleClickEvent

mouseDoubleClickEvent(e: Any) -> None

X.mouseDoubleClickEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#mouseDoubleClickEvent

mouseMoveEvent

mouseMoveEvent(e: Any) -> None

X.mouseMoveEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#mouseMoveEvent

mousePressEvent

mousePressEvent(e: Any) -> None

X.mousePressEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#mousePressEvent

mouseReleaseEvent

mouseReleaseEvent(e: Any) -> None

X.mouseReleaseEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#mouseReleaseEvent

moveCursor

moveCursor(operation: Any, mode: Any) -> None

X.moveCursor(operation, mode)

Supplemental documentation: Qt 5 reference:

void QPlainTextEdit::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.

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/qplaintextedit.html#moveCursor

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPlainTextEdit.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 plain 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).

Access functions:

bool overwriteMode() const
void setOverwriteMode(bool overwrite)

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#overwriteMode

paintEvent

paintEvent(e: Any) -> None

X.paintEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::paintEvent(QPaintEvent *e)

Reimplements: QAbstractScrollArea::paintEvent(QPaintEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

paintEvent(self, e: PySide2.QtGui.QPaintEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#paintEvent

paste

paste() -> None

X.paste()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::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 QPlainTextEdit can paste and how it is being pasted, reimplement the virtual canInsertFromMimeData() and insertFromMimeData() functions.

See also cut() and copy().

Upstream PySide2 reference signatures (binding differences may apply):

paste(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.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.3.

Access functions:

QString placeholderText() const
void setPlaceholderText(const QString \&placeholderText)

See also document().

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#placeholderText

plainText instance-attribute

plainText: Any

Qt 5 reference:

plainText : QString

This property gets and sets the plain text editor's contents. The previous contents are removed and undo/redo history is reset when this property is set. currentCharFormat() is also reset, unless textCursor() is already at the beginning of the document.

By default, for an editor with no contents, this property contains an empty string.

Access functions:

QString toPlainText() const
void setPlainText(const QString \&text)

Notifier signal:

void textChanged()

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#plainText

print

print(printer: Any) -> Any

X.print(printer)

Supplemental documentation: Qt 5 reference:

void QPlainTextEdit::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.

See also QTextDocument::print().

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.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/qplaintextedit.html#readOnly

redo

redo() -> None

X.redo()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::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.

See also undo().

Upstream PySide2 reference signatures (binding differences may apply):

redo(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#redo

redoAvailable

redoAvailable(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPlainTextEdit.redoAvailable; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::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/qplaintextedit.html#redoAvailable

resizeEvent

resizeEvent(e: Any) -> None

X.resizeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#resizeEvent

scrollContentsBy

scrollContentsBy(dx: int, dy: int) -> None

X.scrollContentsBy(dx, dy)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::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/qplaintextedit.html#scrollContentsBy

selectAll

selectAll() -> None

X.selectAll()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::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/qplaintextedit.html#selectAll

selectionChanged

selectionChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPlainTextEdit.selectionChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::selectionChanged()

This signal is emitted whenever the selection changes.

See also copyAvailable().

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#selectionChanged

setBackgroundVisible

setBackgroundVisible(visible: bool) -> None

X.setBackgroundVisible(visible)

Upstream PySide2 reference signatures (binding differences may apply):

setBackgroundVisible(self, visible: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qplaintextedit.html#setBackgroundVisible