QPlainTextDocumentLayout¶
The
QPlainTextDocumentLayout
class implements a plain text layout forQTextDocument
. More…
Synopsis¶
Functions¶
def
cursorWidth
()def
ensureBlockLayout
(block)def
requestUpdate
()def
setCursorWidth
(width)
Detailed Description¶
A
QPlainTextDocumentLayout
is required for text documents that can be display or edited in aQPlainTextEdit
. SeesetDocumentLayout()
.
QPlainTextDocumentLayout
uses theQAbstractTextDocumentLayout
API thatQTextDocument
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 PySide2.QtWidgets.QPlainTextDocumentLayout(document)¶
- param document:
Constructs a plain text document layout for the text
document
.
- PySide2.QtWidgets.QPlainTextDocumentLayout.cursorWidth()¶
- Return type:
int
This property specifies the width of the cursor in pixels. The default value is 1.
- PySide2.QtWidgets.QPlainTextDocumentLayout.ensureBlockLayout(block)¶
- Parameters:
block –
PySide2.QtGui.QTextBlock
Ensures that
block
has a valid layout
- PySide2.QtWidgets.QPlainTextDocumentLayout.requestUpdate()¶
Requests a complete update on all views.
- PySide2.QtWidgets.QPlainTextDocumentLayout.setCursorWidth(width)¶
- Parameters:
width – int
This property specifies the width of the cursor in pixels. The default value is 1.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.