|  | Home · All Classes · Modules

# QPlainTextDocumentLayout Class Reference
[QtGui module]

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

Inherits QAbstractTextDocumentLayout.

### Methods

- __init__ (self, QTextDocument)
- QRectF blockBoundingRect (self, QTextBlock)
- int cursorWidth (self)
- documentChanged (self, int, int, int)
- QSizeF documentSize (self)
- draw (self, QPainter, QAbstractTextDocumentLayout.PaintContext)
- ensureBlockLayout (self, QTextBlock)
- QRectF frameBoundingRect (self, QTextFrame)
- int hitTest (self, QPointF, Qt.HitTestAccuracy)
- int pageCount (self)
- requestUpdate (self)
- setCursorWidth (self, int)

## Detailed Description

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument

A QPlainTextDocumentLayout is required for text documents that can be display or edited in a QPlainTextEdit. See QTextDocument.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.

## Method Documentation

### QPlainTextDocumentLayout.__init__ (self, QTextDocument)

Constructs a plain text document layout for the text document.

### QRectF QPlainTextDocumentLayout.blockBoundingRect (self, QTextBlock)

Reimplemented from QAbstractTextDocumentLayout.blockBoundingRect().

### int QPlainTextDocumentLayout.cursorWidth (self)

### QPlainTextDocumentLayout.documentChanged (self, int, int, int)

Reimplemented from QAbstractTextDocumentLayout.documentChanged().

### QSizeF QPlainTextDocumentLayout.documentSize (self)

Reimplemented from QAbstractTextDocumentLayout.documentSize().

### QPlainTextDocumentLayout.draw (self, QPainter, QAbstractTextDocumentLayout.PaintContext)

Reimplemented from QAbstractTextDocumentLayout.draw().

### QPlainTextDocumentLayout.ensureBlockLayout (self, QTextBlock)

Ensures that block has a valid layout

### QRectF QPlainTextDocumentLayout.frameBoundingRect (self, QTextFrame)

Reimplemented from QAbstractTextDocumentLayout.frameBoundingRect().

### int QPlainTextDocumentLayout.hitTest (self, QPointF, Qt.HitTestAccuracy)

Reimplemented from QAbstractTextDocumentLayout.hitTest().

### int QPlainTextDocumentLayout.pageCount (self)

Reimplemented from QAbstractTextDocumentLayout.pageCount().

### QPlainTextDocumentLayout.requestUpdate (self)

Requests a complete update on all views.

### QPlainTextDocumentLayout.setCursorWidth (self, int)