QPlainTextDocumentLayout

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument . More

Inheritance diagram of PySide6.QtWidgets.QPlainTextDocumentLayout

Synopsis

Functions

Detailed Description

A QPlainTextDocumentLayout is required for text documents that can be display or edited in a QPlainTextEdit . See setDocumentLayout() .

QPlainTextDocumentLayout uses the QAbstractTextDocumentLayout API that QTextDocument requires, but redefines it partially in order to support plain text better. For instances, it does not operate on vertical pixels, but on paragraphs (called blocks) instead. The height of a document is identical to the number of paragraphs it contains. The layout also doesn’t support tables or nested frames, or any sort of advanced text layout that goes beyond a list of paragraphs with syntax highlighting.

class PySide6.QtWidgets.QPlainTextDocumentLayout(document)
Parameters

documentPySide6.QtGui.QTextDocument

Constructs a plain text document layout for the text document.

PySide6.QtWidgets.QPlainTextDocumentLayout.cursorWidth()
Return type

int

See also

setCursorWidth()

PySide6.QtWidgets.QPlainTextDocumentLayout.ensureBlockLayout(block)
Parameters

blockPySide6.QtGui.QTextBlock

Ensures that block has a valid layout

PySide6.QtWidgets.QPlainTextDocumentLayout.requestUpdate()

Requests a complete update on all views.

PySide6.QtWidgets.QPlainTextDocumentLayout.setCursorWidth(width)
Parameters

width – int

See also

cursorWidth()