QPlainTextEdit

Inheritance diagram of QPlainTextEdit

Synopsis

Functions

Virtual functions

Slots

Signals

Detailed Description

The PySide.QtGui.QPlainTextEdit class provides a widget that is used to edit and display plain text.

Introduction and Concepts

PySide.QtGui.QPlainTextEdit is an advanced viewer/editor supporting plain text. It is optimized to handle large documents and to respond quickly to user input.

QPlainText uses very much the same technology and concepts as PySide.QtGui.QTextEdit , but is optimized for plain text handling.

PySide.QtGui.QPlainTextEdit works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signifies a paragraph. A document consists of zero or more paragraphs. Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color.

The shape of the mouse cursor on a PySide.QtGui.QPlainTextEdit is Qt.IBeamCursor by default. It can be changed through the PySide.QtGui.QAbstractScrollArea.viewport() ‘s cursor property.

Using QPlainTextEdit as a Display Widget

The text is set or replaced using PySide.QtGui.QPlainTextEdit.setPlainText() which deletes the existing text and replaces it with the text passed to PySide.QtGui.QPlainTextEdit.setPlainText() .

Text can be inserted using the PySide.QtGui.QTextCursor class or using the convenience functions PySide.QtGui.QPlainTextEdit.insertPlainText() , PySide.QtGui.QPlainTextEdit.appendPlainText() or PySide.QtGui.QPlainTextEdit.paste() .

By default, the text edit wraps words at whitespace to fit within the text edit widget. The PySide.QtGui.QPlainTextEdit.setLineWrapMode() function is used to specify the kind of line wrap you want, WidgetWidth or NoWrap if you don’t want any wrapping. If you use word wrap to the widget’s width WidgetWidth , you can specify whether to break on whitespace or anywhere with PySide.QtGui.QPlainTextEdit.setWordWrapMode() .

The PySide.QtGui.QPlainTextEdit.find() function can be used to find and select a given string within the text.

If you want to limit the total number of paragraphs in a PySide.QtGui.QPlainTextEdit , as it is for example useful in a log viewer, then you can use the PySide.QtGui.QPlainTextEdit.maximumBlockCount() property. The combination of PySide.QtGui.QPlainTextEdit.setMaximumBlockCount() and PySide.QtGui.QPlainTextEdit.appendPlainText() turns PySide.QtGui.QPlainTextEdit into an efficient viewer for log text. The scrolling can be reduced with the PySide.QtGui.QPlainTextEdit.centerOnScroll() property, making the log viewer even faster. Text can be formatted in a limited way, either using a syntax highlighter (see below), or by appending html-formatted text with PySide.QtGui.QPlainTextEdit.appendHtml() . While PySide.QtGui.QPlainTextEdit does not support complex rich text rendering with tables and floats, it does support limited paragraph-based formatting that you may need in a log viewer.

Read-only Key Bindings

When PySide.QtGui.QPlainTextEdit is used read-only the key bindings are limited to navigation, and text may only be selected with the mouse:

Keypresses Action
Qt.UpArrow Moves one line up.
Qt.DownArrow Moves one line down.
Qt.LeftArrow Moves one character to the left.
Qt.RightArrow Moves one character to the right.
PageUp Moves one (viewport) page up.
PageDown Moves one (viewport) page down.
Home Moves to the beginning of the text.
End Moves to the end of the text.
Alt+Wheel Scrolls the page horizontally (the Wheel is the mouse wheel).
Ctrl+Wheel Zooms the text.
Ctrl+A Selects all text.

Using QPlainTextEdit as an Editor

All the information about using PySide.QtGui.QPlainTextEdit as a display widget also applies here.

Selection of text is handled by the PySide.QtGui.QTextCursor class, which provides functionality for creating selections, retrieving the text contents or deleting selections. You can retrieve the object that corresponds with the user-visible cursor using the PySide.QtGui.QPlainTextEdit.textCursor() method. If you want to set a selection in PySide.QtGui.QPlainTextEdit just create one on a PySide.QtGui.QTextCursor object and then make that cursor the visible cursor using PySide.QtGui.QWidget.setCursor() . The selection can be copied to the clipboard with PySide.QtGui.QPlainTextEdit.copy() , or cut to the clipboard with PySide.QtGui.QPlainTextEdit.cut() . The entire text can be selected using PySide.QtGui.QPlainTextEdit.selectAll() .

PySide.QtGui.QPlainTextEdit holds a PySide.QtGui.QTextDocument object which can be retrieved using the PySide.QtGui.QPlainTextEdit.document() method. You can also set your own document object using PySide.QtGui.QPlainTextEdit.setDocument() . PySide.QtGui.QTextDocument emits a PySide.QtGui.QPlainTextEdit.textChanged() signal if the text changes and it also provides a isModified() function which will return true if the text has been modified since it was either loaded or since the last call to setModified with false as argument. In addition it provides methods for undo and redo.

Syntax Highlighting

Editing Key Bindings

The list of key bindings which are implemented for editing:

Keypresses Action
Backspace Deletes the character to the left of the cursor.
Delete Deletes the character to the right of the cursor.
Ctrl+C Copy the selected text to the clipboard.
Ctrl+Insert Copy the selected text to the clipboard.
Ctrl+K Deletes to the end of the line.
Ctrl+V Pastes the clipboard text into text edit.
Shift+Insert Pastes the clipboard text into text edit.
Ctrl+X Deletes the selected text and copies it to the clipboard.
Shift+Delete Deletes the selected text and copies it to the clipboard.
Ctrl+Z Undoes the last operation.
Ctrl+Y Redoes the last operation.
LeftArrow Moves the cursor one character to the left.
Ctrl+LeftArrow Moves the cursor one word to the left.
RightArrow Moves the cursor one character to the right.
Ctrl+RightArrow Moves the cursor one word to the right.
UpArrow Moves the cursor one line up.
Ctrl+UpArrow Moves the cursor one word up.
DownArrow Moves the cursor one line down.
Ctrl+Down Arrow Moves the cursor one word down.
PageUp Moves the cursor one page up.
PageDown Moves the cursor one page down.
Home Moves the cursor to the beginning of the line.
Ctrl+Home Moves the cursor to the beginning of the text.
End Moves the cursor to the end of the line.
Ctrl+End Moves the cursor to the end of the text.
Alt+Wheel Scrolls the page horizontally (the Wheel is the mouse wheel).
Ctrl+Wheel Zooms the text.

To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, Shift+Right Arrow will select the character to the right, and Shift+Ctrl+Right Arrow will select the word to the right, etc.

Differences to QTextEdit

PySide.QtGui.QPlainTextEdit is a thin class, implemented by using most of the technology that is behind PySide.QtGui.QTextEdit and PySide.QtGui.QTextDocument . Its performance benefits over PySide.QtGui.QTextEdit stem mostly from using a different and simplified text layout called PySide.QtGui.QPlainTextDocumentLayout on the text document (see QTextDocument.setDocumentLayout() ). The plain text document layout does not support tables nor embedded frames, and replaces a pixel-exact height calculation with a line-by-line respectively paragraph-by-paragraph scrolling approach . This makes it possible to handle significantly larger documents, and still resize the editor with line wrap enabled in real time. It also makes for a fast log viewer (see PySide.QtGui.QPlainTextEdit.setMaximumBlockCount() ).

See also

PySide.QtGui.QTextDocument PySide.QtGui.QTextCursor Application Example Code Editor Example Syntax Highlighter Example Rich Text Processing

class PySide.QtGui.QPlainTextEdit([parent=None])
class PySide.QtGui.QPlainTextEdit(text[, parent=None])
Parameters:

Constructs an empty PySide.QtGui.QPlainTextEdit with parent parent .

Constructs a PySide.QtGui.QPlainTextEdit with parent parent . The text edit will display the plain text text .

PySide.QtGui.QPlainTextEdit.LineWrapMode
Constant Description
QPlainTextEdit.NoWrap  
QPlainTextEdit.WidgetWidth  
PySide.QtGui.QPlainTextEdit.anchorAt(pos)
Parameters:posPySide.QtCore.QPoint
Return type:unicode

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

PySide.QtGui.QPlainTextEdit.appendHtml(html)
Parameters:html – unicode

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

PySide.QtGui.QPlainTextEdit.appendPlainText()

PySide.QtGui.QPlainTextEdit.appendPlainText(text)
Parameters:text – unicode

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

PySide.QtGui.QPlainTextEdit.backgroundVisible()
Return type:PySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.blockBoundingGeometry(block)
Parameters:blockPySide.QtGui.QTextBlock
Return type:PySide.QtCore.QRectF

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

PySide.QtGui.QPlainTextEdit.blockBoundingRect(block)
Parameters:blockPySide.QtGui.QTextBlock
Return type:PySide.QtCore.QRectF

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

PySide.QtGui.QPlainTextEdit.blockCount()
Return type:PySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.blockCountChanged(newBlockCount)
Parameters:newBlockCountPySide.QtCore.int
PySide.QtGui.QPlainTextEdit.canInsertFromMimeData(source)
Parameters:sourcePySide.QtCore.QMimeData
Return type:PySide.QtCore.bool

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.

PySide.QtGui.QPlainTextEdit.canPaste()
Return type:PySide.QtCore.bool

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

PySide.QtGui.QPlainTextEdit.centerCursor()

Scrolls the document in order to center the cursor vertically.

PySide.QtGui.QPlainTextEdit.centerOnScroll()
Return type:PySide.QtCore.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 PySide.QtGui.QPlainTextEdit.appendPlainText() .

The default is false.

PySide.QtGui.QPlainTextEdit.clear()

Deletes all the text in the text edit.

Note that the undo/redo history is cleared by this function.

PySide.QtGui.QPlainTextEdit.contentOffset()
Return type:PySide.QtCore.QPointF

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.

PySide.QtGui.QPlainTextEdit.copy()

Copies any selected text to the clipboard.

PySide.QtGui.QPlainTextEdit.copyAvailable(b)
Parameters:bPySide.QtCore.bool
PySide.QtGui.QPlainTextEdit.createMimeDataFromSelection()
Return type:PySide.QtCore.QMimeData

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 PySide.QtCore.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 PySide.QtCore.QMimeData object is passed to the caller. The selection can be retrieved by using the PySide.QtGui.QPlainTextEdit.textCursor() function.

PySide.QtGui.QPlainTextEdit.createStandardContextMenu()
Return type:PySide.QtGui.QMenu

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

PySide.QtGui.QPlainTextEdit.currentCharFormat()
Return type:PySide.QtGui.QTextCharFormat

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

PySide.QtGui.QPlainTextEdit.cursorForPosition(pos)
Parameters:posPySide.QtCore.QPoint
Return type:PySide.QtGui.QTextCursor

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

PySide.QtGui.QPlainTextEdit.cursorPositionChanged()
PySide.QtGui.QPlainTextEdit.cursorRect(cursor)
Parameters:cursorPySide.QtGui.QTextCursor
Return type:PySide.QtCore.QRect

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

PySide.QtGui.QPlainTextEdit.cursorRect()
Return type:PySide.QtCore.QRect

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

PySide.QtGui.QPlainTextEdit.cursorWidth()
Return type:PySide.QtCore.int

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

PySide.QtGui.QPlainTextEdit.cut()

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

If there is no selected text nothing happens.

PySide.QtGui.QPlainTextEdit.document()
Return type:PySide.QtGui.QTextDocument

Returns a pointer to the underlying document.

PySide.QtGui.QPlainTextEdit.documentTitle()
Return type:unicode

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

By default, this property contains an empty string.

PySide.QtGui.QPlainTextEdit.ensureCursorVisible()

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

PySide.QtGui.QPlainTextEdit.extraSelections()
Return type:

Returns previously set extra selections.

PySide.QtGui.QPlainTextEdit.find(exp[, options=0])
Parameters:
  • exp – unicode
  • optionsPySide.QtGui.QTextDocument.FindFlags
Return type:

PySide.QtCore.bool

PySide.QtGui.QPlainTextEdit.firstVisibleBlock()
Return type:PySide.QtGui.QTextBlock

Returns the first visible block.

PySide.QtGui.QPlainTextEdit.getPaintContext()
Return type:PySide.QtGui.QAbstractTextDocumentLayout::PaintContext

Returns the paint context for the PySide.QtGui.QAbstractScrollArea.viewport() , useful only when reimplementing PySide.QtGui.QPlainTextEdit.paintEvent() .

PySide.QtGui.QPlainTextEdit.insertFromMimeData(source)
Parameters:sourcePySide.QtCore.QMimeData

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.

PySide.QtGui.QPlainTextEdit.insertPlainText(text)
Parameters:text – unicode

Convenience slot that inserts text at the current cursor position.

It is equivalent to

edit.textCursor().insertText(text)
PySide.QtGui.QPlainTextEdit.isReadOnly()
Return type:PySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.isUndoRedoEnabled()
Return type:PySide.QtCore.bool

This property holds whether undo and redo are enabled.

Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).

By default, this property is true.

PySide.QtGui.QPlainTextEdit.lineWrapMode()
Return type:PySide.QtGui.QPlainTextEdit.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 PySide.QtGui.QPlainTextEdit.setWordWrapMode() .

PySide.QtGui.QPlainTextEdit.loadResource(type, name)
Parameters:
Return type:

object

Loads the resource specified by the given type and name .

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

PySide.QtGui.QPlainTextEdit.maximumBlockCount()
Return type:PySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.mergeCurrentCharFormat(modifier)
Parameters:modifierPySide.QtGui.QTextCharFormat

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.

PySide.QtGui.QPlainTextEdit.modificationChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtGui.QPlainTextEdit.moveCursor(operation[, mode=QTextCursor.MoveAnchor])
Parameters:
PySide.QtGui.QPlainTextEdit.overwriteMode()
Return type:PySide.QtCore.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).

PySide.QtGui.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 PySide.QtGui.QPlainTextEdit can paste and how it is being pasted, reimplement the virtual PySide.QtGui.QPlainTextEdit.canInsertFromMimeData() and PySide.QtGui.QPlainTextEdit.insertFromMimeData() functions.

PySide.QtGui.QPlainTextEdit.print_(printer)
Parameters:printerPySide.QtGui.QPrinter

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

PySide.QtGui.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.

PySide.QtGui.QPlainTextEdit.redoAvailable(b)
Parameters:bPySide.QtCore.bool
PySide.QtGui.QPlainTextEdit.selectAll()

Selects all text.

PySide.QtGui.QPlainTextEdit.selectionChanged()
PySide.QtGui.QPlainTextEdit.setBackgroundVisible(visible)
Parameters:visiblePySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.setCenterOnScroll(enabled)
Parameters:enabledPySide.QtCore.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 PySide.QtGui.QPlainTextEdit.appendPlainText() .

The default is false.

PySide.QtGui.QPlainTextEdit.setCurrentCharFormat(format)
Parameters:formatPySide.QtGui.QTextCharFormat

Sets the char format that is be used when inserting new text to format by calling QTextCursor.setCharFormat() on the editor’s cursor. If the editor has a selection then the char format is directly applied to the selection.

PySide.QtGui.QPlainTextEdit.setCursorWidth(width)
Parameters:widthPySide.QtCore.int

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

PySide.QtGui.QPlainTextEdit.setDocument(document)
Parameters:documentPySide.QtGui.QTextDocument

Makes document the new document of the text editor.

The parent PySide.QtCore.QObject of the provided document remains the owner of the object. If the current document is a child of the text editor, then it is deleted.

The document must have a document layout that inherits PySide.QtGui.QPlainTextDocumentLayout (see QTextDocument.setDocumentLayout() ).

PySide.QtGui.QPlainTextEdit.setDocumentTitle(title)
Parameters:title – unicode

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

By default, this property contains an empty string.

PySide.QtGui.QPlainTextEdit.setExtraSelections(selections)
Parameters:selections
PySide.QtGui.QPlainTextEdit.setLineWrapMode(mode)
Parameters:modePySide.QtGui.QPlainTextEdit.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 PySide.QtGui.QPlainTextEdit.setWordWrapMode() .

PySide.QtGui.QPlainTextEdit.setMaximumBlockCount(maximum)
Parameters:maximumPySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.setOverwriteMode(overwrite)
Parameters:overwritePySide.QtCore.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).

PySide.QtGui.QPlainTextEdit.setPlainText(text)
Parameters:text – unicode

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.

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

PySide.QtGui.QPlainTextEdit.setReadOnly(ro)
Parameters:roPySide.QtCore.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.

PySide.QtGui.QPlainTextEdit.setTabChangesFocus(b)
Parameters:bPySide.QtCore.bool

This property holds whether Tab changes focus or is accepted as input.

In some occasions text edits should not allow the user to input tabulators or change indentation using the Tab key, as this breaks the focus chain. The default is false.

PySide.QtGui.QPlainTextEdit.setTabStopWidth(width)
Parameters:widthPySide.QtCore.int

This property holds the tab stop width in pixels.

By default, this property contains a value of 80.

PySide.QtGui.QPlainTextEdit.setTextCursor(cursor)
Parameters:cursorPySide.QtGui.QTextCursor

Sets the visible cursor .

PySide.QtGui.QPlainTextEdit.setTextInteractionFlags(flags)
Parameters:flagsPySide.QtCore.Qt.TextInteractionFlags

Specifies how the label should interact with user input if it displays text.

If the flags contain either Qt.LinksAccessibleByKeyboard or Qt.TextSelectableByKeyboard then the focus policy is also automatically set to Qt.ClickFocus .

The default value depends on whether the PySide.QtGui.QPlainTextEdit is read-only or editable.

PySide.QtGui.QPlainTextEdit.setUndoRedoEnabled(enable)
Parameters:enablePySide.QtCore.bool

This property holds whether undo and redo are enabled.

Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).

By default, this property is true.

PySide.QtGui.QPlainTextEdit.setWordWrapMode(policy)
Parameters:policyPySide.QtGui.QTextOption.WrapMode
PySide.QtGui.QPlainTextEdit.tabChangesFocus()
Return type:PySide.QtCore.bool

This property holds whether Tab changes focus or is accepted as input.

In some occasions text edits should not allow the user to input tabulators or change indentation using the Tab key, as this breaks the focus chain. The default is false.

PySide.QtGui.QPlainTextEdit.tabStopWidth()
Return type:PySide.QtCore.int

This property holds the tab stop width in pixels.

By default, this property contains a value of 80.

PySide.QtGui.QPlainTextEdit.textChanged()
PySide.QtGui.QPlainTextEdit.textCursor()
Return type:PySide.QtGui.QTextCursor

Returns a copy of the PySide.QtGui.QTextCursor that represents the currently visible cursor. Note that changes on the returned cursor do not affect PySide.QtGui.QPlainTextEdit ‘s cursor; use PySide.QtGui.QPlainTextEdit.setTextCursor() to update the visible cursor.

PySide.QtGui.QPlainTextEdit.textInteractionFlags()
Return type:PySide.QtCore.Qt.TextInteractionFlags

Specifies how the label should interact with user input if it displays text.

If the flags contain either Qt.LinksAccessibleByKeyboard or Qt.TextSelectableByKeyboard then the focus policy is also automatically set to Qt.ClickFocus .

The default value depends on whether the PySide.QtGui.QPlainTextEdit is read-only or editable.

PySide.QtGui.QPlainTextEdit.toPlainText()
Return type:unicode

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.

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

PySide.QtGui.QPlainTextEdit.undo()

Undoes the last operation.

If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.

PySide.QtGui.QPlainTextEdit.undoAvailable(b)
Parameters:bPySide.QtCore.bool
PySide.QtGui.QPlainTextEdit.updateRequest(rect, dy)
Parameters:
PySide.QtGui.QPlainTextEdit.wordWrapMode()
Return type:PySide.QtGui.QTextOption.WrapMode