Skip to content

PythonQt.QtGui.QTextEdit · declarations 001

Back to PythonQt.QtGui.QTextEdit

ExtraSelection instance-attribute

ExtraSelection: type

PythonQtInstanceWrapper object

acceptRichText instance-attribute

acceptRichText: bool

Qt 5 reference:

acceptRichText : bool

This property holds whether the text edit accepts rich text insertions by the user

When this propery is set to false text edit will accept only plain text input from the user. For example through clipboard or drag and drop.

This property's default is true.

This property was introduced in Qt 4.1.

Access functions:

bool acceptRichText() const
void setAcceptRichText(bool accept)

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#acceptRichText

alignment

alignment() -> Any

X.alignment()

Supplemental documentation: Qt 5 reference:

Qt::Alignment QTextEdit::alignment() const

Returns the alignment of the current paragraph.

See also setAlignment().

Upstream PySide2 reference signatures (binding differences may apply):

alignment(self) -> PySide2.QtCore.Qt.Alignment

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#alignment

anchorAt

anchorAt(pos: Any) -> str

X.anchorAt(pos) -> str

Supplemental documentation: Qt 5 reference:

QString QTextEdit::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.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

append

append(text: str) -> None

X.append(text)

Supplemental documentation: Qt 5 reference:

[slot] void QTextEdit::append(const QString \&text)

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

Note: The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.

See also currentCharFormat() and QTextCursor::blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

append(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#append

autoFormatting instance-attribute

autoFormatting: Any

Qt 5 reference:

autoFormatting : AutoFormatting

This property holds the enabled set of auto formatting features

The value can be any combination of the values in the AutoFormattingFlag enum. The default is AutoNone. Choose AutoAll to enable all automatic formatting.

Currently, the only automatic formatting feature provided is AutoBulletList; future versions of Qt may offer more.

Access functions:

QTextEdit::AutoFormatting autoFormatting() const
void setAutoFormatting(QTextEdit::AutoFormatting features)

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#autoFormatting

canInsertFromMimeData

canInsertFromMimeData(source: Any) -> bool

X.canInsertFromMimeData(source) -> bool

Supplemental documentation: Qt 5 reference:

[virtual protected] bool QTextEdit::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 and drop operation.

Reimplement this function to enable drag and drop support for additional MIME types.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

canPaste

canPaste() -> bool

X.canPaste() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextEdit::canPaste() const

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

This function was introduced in Qt 4.2.

Upstream PySide2 reference signatures (binding differences may apply):

canPaste(self) -> bool

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

changeEvent

changeEvent(e: Any) -> None

X.changeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#changeEvent

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

[slot] void QTextEdit::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(), setPlainText(), and setHtml().

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

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

contextMenuEvent

contextMenuEvent(e: Any) -> None

X.contextMenuEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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 MyTextEdit::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/qtextedit.html#contextMenuEvent

copy

copy() -> None

X.copy()

Supplemental documentation: Qt 5 reference:

[slot] void QTextEdit::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/qtextedit.html#copy

copyAvailable

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QTextEdit::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/qtextedit.html#copyAvailable

createMimeDataFromSelection

createMimeDataFromSelection() -> Any

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

Supplemental documentation: Qt 5 reference:

[virtual protected] QMimeData *QTextEdit::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/qtextedit.html#createMimeDataFromSelection

createStandardContextMenu

createStandardContextMenu(position: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

QMenu *QTextEdit::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 *QTextEdit::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 4.4.

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/qtextedit.html#createStandardContextMenu

currentCharFormat

currentCharFormat() -> Any

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

Supplemental documentation: Qt 5 reference:

QTextCharFormat QTextEdit::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/qtextedit.html#currentCharFormat

currentCharFormatChanged

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

Native PythonQt.QtGui.QTextEdit.currentCharFormatChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QTextEdit::currentCharFormatChanged(const QTextCharFormat \&f)

This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.

The new format is f.

See also setCurrentCharFormat().

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#currentCharFormatChanged

currentFont

currentFont() -> Any

X.currentFont() -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

QFont QTextEdit::currentFont() const

Returns the font of the current format.

See also setCurrentFont(), setFontFamily(), and setFontPointSize().

Upstream PySide2 reference signatures (binding differences may apply):

currentFont(self) -> PySide2.QtGui.QFont

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#currentFont

cursorForPosition

cursorForPosition(pos: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

QTextCursor QTextEdit::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/qtextedit.html#cursorForPosition

cursorPositionChanged

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QTextEdit::cursorPositionChanged()

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

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

cursorRect

cursorRect(cursor: Any) -> Any

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

Supplemental documentation: Qt 5 reference:

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

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

QRect QTextEdit::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/qtextedit.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.

This property was introduced in Qt 4.2.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

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

customContextMenuRequested

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

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

cut

cut() -> None

X.cut()

Supplemental documentation: Qt 5 reference:

[slot] void QTextEdit::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/qtextedit.html#cut

destroyed

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

Native PythonQt.QtGui.QTextEdit.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/qtextedit.html#doSetTextCursor

document instance-attribute

document: QTextDocument

Qt 5 reference:

document : QTextDocument*

This property holds the underlying document of the text editor.

Note: The editor does not take ownership of the document unless it is the document's parent object. The parent object of the provided document remains the owner of the object. If the previously assigned document is a child of the editor then it will be deleted.

Access functions:

QTextDocument * document() const
void setDocument(QTextDocument *document)

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.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, for a newly-created, empty document, 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/qtextedit.html#documentTitle

dragEnterEvent

dragEnterEvent(e: Any) -> None

X.dragEnterEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#dragEnterEvent

dragLeaveEvent

dragLeaveEvent(e: Any) -> None

X.dragLeaveEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#dragLeaveEvent

dragMoveEvent

dragMoveEvent(e: Any) -> None

X.dragMoveEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#dragMoveEvent

dropEvent

dropEvent(e: Any) -> None

X.dropEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#dropEvent

ensureCursorVisible

ensureCursorVisible() -> None

X.ensureCursorVisible()

Supplemental documentation: Qt 5 reference:

void QTextEdit::ensureCursorVisible()

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

Upstream PySide2 reference signatures (binding differences may apply):

ensureCursorVisible(self) -> None

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

extraSelections

extraSelections() -> tuple

X.extraSelections() -> tuple

Supplemental documentation: Qt 5 reference:

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

Returns previously set extra selections.

This function was introduced in Qt 4.2.

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/qtextedit.html#extraSelections

find

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

X.find(exp, options) -> bool

Supplemental documentation: Qt 5 reference:

bool QTextEdit::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 QTextEdit::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 QTextEdit::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/qtextedit.html#find

focusInEvent

focusInEvent(e: Any) -> None

X.focusInEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#focusInEvent

focusNextPrevChild

focusNextPrevChild(next: bool) -> bool

X.focusNextPrevChild(next) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QTextEdit::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/qtextedit.html#focusNextPrevChild

focusOutEvent

focusOutEvent(e: Any) -> None

X.focusOutEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QTextEdit::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/qtextedit.html#focusOutEvent

fontFamily

fontFamily() -> str

X.fontFamily() -> str

Supplemental documentation: Qt 5 reference:

QString QTextEdit::fontFamily() const

Returns the font family of the current format.

See also setFontFamily(), setCurrentFont(), and setFontPointSize().

Upstream PySide2 reference signatures (binding differences may apply):

fontFamily(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qtextedit.html#fontFamily