Skip to content

PythonQt.QtGui.QPlainTextEdit · declarations 001

Back to PythonQt.QtGui.QPlainTextEdit

LineWrapMode instance-attribute

LineWrapMode: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

NoWrap instance-attribute

NoWrap: Any

WidgetWidth instance-attribute

WidgetWidth: Any

anchorAt

anchorAt(pos: Any) -> str

X.anchorAt(pos) -> str

Supplemental documentation: Qt 5 reference:

QString QPlainTextEdit::anchorAt(const QPoint \&pos) const

Returns the reference of the anchor at position pos, or an empty string if no anchor exists at that point.

This function was introduced in Qt 4.7.

Upstream PySide2 reference signatures (binding differences may apply):

anchorAt(self, pos: PySide2.QtCore.QPoint) -> str

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

appendHtml

appendHtml(html: str) -> None

X.appendHtml(html)

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::appendHtml(const QString \&html)

Appends a new paragraph with html to the end of the text edit.

appendPlainText()

Upstream PySide2 reference signatures (binding differences may apply):

appendHtml(self, html: str) -> None

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

appendPlainText

appendPlainText(text: str) -> None

X.appendPlainText(text)

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::appendPlainText(const QString \&text)

Appends a new paragraph with text to the end of the text edit.

See also appendHtml().

Upstream PySide2 reference signatures (binding differences may apply):

appendPlainText(self, text: str) -> None

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

backgroundVisible instance-attribute

backgroundVisible: bool

Qt 5 reference:

backgroundVisible : bool

This property holds whether the palette background is visible outside the document area

If set to true, the plain text edit paints the palette background on the viewport area not covered by the text document. Otherwise, if set to false, it won't. The feature makes it possible for the user to visually distinguish between the area of the document, painted with the base color of the palette, and the empty area not covered by any document.

The default is false.

Access functions:

bool backgroundVisible() const
void setBackgroundVisible(bool visible)

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

blockBoundingGeometry

blockBoundingGeometry(block: Any) -> Any

X.blockBoundingGeometry(block) -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

[protected] QRectF QPlainTextEdit::blockBoundingGeometry(const QTextBlock \&block) const

Returns the bounding rectangle of the text block in content coordinates. Translate the rectangle with the contentOffset() to get visual coordinates on the viewport.

See also firstVisibleBlock() and blockBoundingRect().

Upstream PySide2 reference signatures (binding differences may apply):

blockBoundingGeometry(self, block: PySide2.QtGui.QTextBlock) -> PySide2.QtCore.QRectF

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

blockBoundingRect

blockBoundingRect(block: Any) -> Any

X.blockBoundingRect(block) -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

[protected] QRectF QPlainTextEdit::blockBoundingRect(const QTextBlock \&block) const

Returns the bounding rectangle of the text block in the block's own coordinates.

See also blockBoundingGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

blockBoundingRect(self, block: PySide2.QtGui.QTextBlock) -> PySide2.QtCore.QRectF

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

blockCount instance-attribute

blockCount: int

Qt 5 reference:

blockCount : const int

This property holds the number of text blocks in the document.

By default, in an empty document, this property contains a value of 1.

Access functions:

int blockCount() const

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

blockCountChanged

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::blockCountChanged(int newBlockCount)

This signal is emitted whenever the block count changes. The new block count is passed in newBlockCount.

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

canInsertFromMimeData

canInsertFromMimeData(source: Any) -> bool

X.canInsertFromMimeData(source) -> bool

Supplemental documentation: Qt 5 reference:

[virtual protected] bool QPlainTextEdit::canInsertFromMimeData(const QMimeData *source) const

This function returns true if the contents of the MIME data object, specified by source, can be decoded and inserted into the document. It is called for example when during a drag operation the mouse enters this widget and it is necessary to determine whether it is possible to accept the drag.

Upstream PySide2 reference signatures (binding differences may apply):

canInsertFromMimeData(self, source: PySide2.QtCore.QMimeData) -> bool

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

canPaste

canPaste() -> bool

X.canPaste() -> bool

Supplemental documentation: Qt 5 reference:

bool QPlainTextEdit::canPaste() const

Returns whether text can be pasted from the clipboard into the textedit.

Upstream PySide2 reference signatures (binding differences may apply):

canPaste(self) -> bool

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

centerCursor

centerCursor() -> None

X.centerCursor()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::centerCursor()

Scrolls the document in order to center the cursor vertically.

See also ensureCursorVisible() and centerOnScroll.

Upstream PySide2 reference signatures (binding differences may apply):

centerCursor(self) -> None

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

centerOnScroll instance-attribute

centerOnScroll: bool

Qt 5 reference:

centerOnScroll : bool

This property holds whether the cursor should be centered on screen

If set to true, the plain text edit scrolls the document vertically to make the cursor visible at the center of the viewport. This also allows the text edit to scroll below the end of the document. Otherwise, if set to false, the plain text edit scrolls the smallest amount possible to ensure the cursor is visible. The same algorithm is applied to any new line appended through appendPlainText().

The default is false.

Access functions:

bool centerOnScroll() const
void setCenterOnScroll(bool enabled)

See also centerCursor() and ensureCursorVisible().

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

changeEvent

changeEvent(e: Any) -> None

X.changeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::changeEvent(QEvent *e)

Reimplements: QFrame::changeEvent(QEvent *ev).

Upstream PySide2 reference signatures (binding differences may apply):

changeEvent(self, e: PySide2.QtCore.QEvent) -> None

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

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::clear()

Deletes all the text in the text edit.

Notes:

  • The undo/redo history is also cleared.
  • currentCharFormat() is reset, unless textCursor() is already at the beginning of the document.

See also cut() and setPlainText().

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

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

contentOffset

contentOffset() -> Any

X.contentOffset() -> PythonQt.QtCore.QPointF

Supplemental documentation: Qt 5 reference:

[protected] QPointF QPlainTextEdit::contentOffset() const

Returns the content's origin in viewport coordinates.

The origin of the content of a plain text edit is always the top left corner of the first visible text block. The content offset is different from (0,0) when the text has been scrolled horizontally, or when the first visible block has been scrolled partially off the screen, i.e. the visible text does not start with the first line of the first visible block, or when the first visible block is the very first block and the editor displays a margin.

See also firstVisibleBlock(), horizontalScrollBar(), and verticalScrollBar().

Upstream PySide2 reference signatures (binding differences may apply):

contentOffset(self) -> PySide2.QtCore.QPointF

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

contextMenuEvent

contextMenuEvent(e: Any) -> None

X.contextMenuEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)

Reimplements: QAbstractScrollArea::contextMenuEvent(QContextMenuEvent *e).

Shows the standard context menu created with createStandardContextMenu().

If you do not want the text edit to have a context menu, you can set its contextMenuPolicy to Qt::NoContextMenu. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call createStandardContextMenu() and extend the menu returned.

Information about the event is passed in the event object.

void MyQPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
{
    QMenu *menu = createStandardContextMenu();
    menu->addAction(tr("My Menu Item"));
    //...
    menu->exec(event->globalPos());
    delete menu;
}

Upstream PySide2 reference signatures (binding differences may apply):

contextMenuEvent(self, e: PySide2.QtGui.QContextMenuEvent) -> None

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

copy

copy() -> None

X.copy()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::copy()

Copies any selected text to the clipboard.

See also copyAvailable().

Upstream PySide2 reference signatures (binding differences may apply):

copy(self) -> None

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

copyAvailable

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::copyAvailable(bool yes)

This signal is emitted when text is selected or de-selected in the text edit.

When text is selected this signal will be emitted with yes set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with yes set to false.

If yes is true then copy() can be used to copy the selection to the clipboard. If yes is false then copy() does nothing.

See also selectionChanged().

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

createMimeDataFromSelection

createMimeDataFromSelection() -> Any

X.createMimeDataFromSelection() -> PythonQt.QtCore.QMimeData

Supplemental documentation: Qt 5 reference:

[virtual protected] QMimeData *QPlainTextEdit::createMimeDataFromSelection() const

This function returns a new MIME data object to represent the contents of the text edit's current selection. It is called when the selection needs to be encapsulated into a new QMimeData object; for example, when a drag and drop operation is started, or when data is copied to the clipboard.

If you reimplement this function, note that the ownership of the returned QMimeData object is passed to the caller. The selection can be retrieved by using the textCursor() function.

Upstream PySide2 reference signatures (binding differences may apply):

createMimeDataFromSelection(self) -> PySide2.QtCore.QMimeData

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

createStandardContextMenu

createStandardContextMenu(position: Any) -> Any

X.createStandardContextMenu(position) -> PythonQt.QtGui.QMenu

Supplemental documentation: Qt 5 reference:

QMenu *QPlainTextEdit::createStandardContextMenu()

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler. The popup menu's ownership is transferred to the caller.

We recommend that you use the createStandardContextMenu(QPoint) version instead which will enable the actions that are sensitive to where the user clicked.

QMenu *QPlainTextEdit::createStandardContextMenu(const QPoint \&position)

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler and it takes the position in document coordinates where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.

This function was introduced in Qt 5.5.

Upstream PySide2 reference signatures (binding differences may apply):

createStandardContextMenu(self) -> PySide2.QtWidgets.QMenu
createStandardContextMenu(self, position: PySide2.QtCore.QPoint) -> PySide2.QtWidgets.QMenu

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

currentCharFormat

currentCharFormat() -> Any

X.currentCharFormat() -> PythonQt.QtGui.QTextCharFormat

Supplemental documentation: Qt 5 reference:

QTextCharFormat QPlainTextEdit::currentCharFormat() const

Returns the char format that is used when inserting new text.

See also setCurrentCharFormat().

Upstream PySide2 reference signatures (binding differences may apply):

currentCharFormat(self) -> PySide2.QtGui.QTextCharFormat

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

cursorForPosition

cursorForPosition(pos: Any) -> Any

X.cursorForPosition(pos) -> PythonQt.QtGui.QTextCursor

Supplemental documentation: Qt 5 reference:

QTextCursor QPlainTextEdit::cursorForPosition(const QPoint \&pos) const

returns a QTextCursor at position pos (in viewport coordinates).

Upstream PySide2 reference signatures (binding differences may apply):

cursorForPosition(self, pos: PySide2.QtCore.QPoint) -> PySide2.QtGui.QTextCursor

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

cursorPositionChanged

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QPlainTextEdit::cursorPositionChanged()

This signal is emitted whenever the position of the cursor changed.

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

cursorRect

cursorRect(cursor: Any) -> Any

X.cursorRect(cursor) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QPlainTextEdit::cursorRect(const QTextCursor \&cursor) const

returns a rectangle (in viewport coordinates) that includes the cursor.

QRect QPlainTextEdit::cursorRect() const

returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.

Upstream PySide2 reference signatures (binding differences may apply):

cursorRect(self) -> PySide2.QtCore.QRect
cursorRect(self, cursor: PySide2.QtGui.QTextCursor) -> PySide2.QtCore.QRect

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

cursorWidth instance-attribute

cursorWidth: int

Qt 5 reference:

cursorWidth : int

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

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

customContextMenuRequested

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

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

cut

cut() -> None

X.cut()

Supplemental documentation: Qt 5 reference:

[slot] void QPlainTextEdit::cut()

Copies the selected text to the clipboard and deletes it from the text edit.

If there is no selected text nothing happens.

See also copy() and paste().

Upstream PySide2 reference signatures (binding differences may apply):

cut(self) -> None

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

destroyed

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

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

doSetTextCursor

doSetTextCursor(cursor: Any) -> None

X.doSetTextCursor(cursor)

Upstream PySide2 reference signatures (binding differences may apply):

doSetTextCursor(self, cursor: PySide2.QtGui.QTextCursor) -> None

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

document

document() -> Any

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

Supplemental documentation: Qt 5 reference:

QTextDocument *QPlainTextEdit::document() const

Returns a pointer to the underlying document.

See also setDocument().

Upstream PySide2 reference signatures (binding differences may apply):

document(self) -> PySide2.QtGui.QTextDocument

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

documentTitle instance-attribute

documentTitle: str

Qt 5 reference:

documentTitle : QString

This property holds the title of the document parsed from the text.

By default, this property contains an empty string.

Access functions:

QString documentTitle() const
void setDocumentTitle(const QString \&title)

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

dragEnterEvent

dragEnterEvent(e: Any) -> None

X.dragEnterEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::dragEnterEvent(QDragEnterEvent *e)

Reimplements: QAbstractScrollArea::dragEnterEvent(QDragEnterEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragEnterEvent(self, e: PySide2.QtGui.QDragEnterEvent) -> None

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

dragLeaveEvent

dragLeaveEvent(e: Any) -> None

X.dragLeaveEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::dragLeaveEvent(QDragLeaveEvent *e)

Reimplements: QAbstractScrollArea::dragLeaveEvent(QDragLeaveEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragLeaveEvent(self, e: PySide2.QtGui.QDragLeaveEvent) -> None

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

dragMoveEvent

dragMoveEvent(e: Any) -> None

X.dragMoveEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::dragMoveEvent(QDragMoveEvent *e)

Reimplements: QAbstractScrollArea::dragMoveEvent(QDragMoveEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragMoveEvent(self, e: PySide2.QtGui.QDragMoveEvent) -> None

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

dropEvent

dropEvent(e: Any) -> None

X.dropEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPlainTextEdit::dropEvent(QDropEvent *e)

Reimplements: QAbstractScrollArea::dropEvent(QDropEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dropEvent(self, e: PySide2.QtGui.QDropEvent) -> None

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

ensureCursorVisible

ensureCursorVisible() -> None

X.ensureCursorVisible()

Supplemental documentation: Qt 5 reference:

void QPlainTextEdit::ensureCursorVisible()

Ensures that the cursor is visible by scrolling the text edit if necessary.

See also centerCursor() and centerOnScroll.

Upstream PySide2 reference signatures (binding differences may apply):

ensureCursorVisible(self) -> None

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

event

event(e: Any) -> bool

X.event(e) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

event(self, e: PySide2.QtCore.QEvent) -> bool

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