Home · All Classes · Modules

QPlainTextDocumentLayout Class Reference
[QtGui module]

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

Inherits QAbstractTextDocumentLayout.

Methods


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

Constructs a plain text document layout for the text document.

QRectF QPlainTextDocumentLayout.blockBoundingRect (self, QTextBlock block)

Reimplemented from QAbstractTextDocumentLayout.blockBoundingRect().

int QPlainTextDocumentLayout.cursorWidth (self)

QPlainTextDocumentLayout.documentChanged (self, int from, int, int charsAdded)

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

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


PyQt 4.12.1 for X11Copyright © Riverbank Computing Ltd and The Qt Company 2015Qt 4.8.7