The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument. More...
Header: | #include <QPlainTextDocumentLayout> |
qmake: | QT += widgets |
Since: | Qt 4.4 |
Inherits: | QAbstractTextDocumentLayout |
QPlainTextDocumentLayout(QTextDocument *document) | |
virtual | ~QPlainTextDocumentLayout() |
int | cursorWidth() const |
void | ensureBlockLayout(const QTextBlock &block) const |
void | requestUpdate() |
void | setCursorWidth(int width) |
virtual QRectF | blockBoundingRect(const QTextBlock &block) const override |
virtual QSizeF | documentSize() const override |
virtual void | draw(QPainter *, const QAbstractTextDocumentLayout::PaintContext &) override |
virtual QRectF | frameBoundingRect(QTextFrame *) const override |
virtual int | hitTest(const QPointF &, Qt::HitTestAccuracy) const override |
virtual int | pageCount() const override |
virtual void | documentChanged(int from, int charsRemoved, int charsAdded) override |
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.
This property specifies the width of the cursor in pixels. The default value is 1.
Access functions:
int | cursorWidth() const |
void | setCursorWidth(int width) |
Constructs a plain text document layout for the text document.
[virtual]
QPlainTextDocumentLayout::~QPlainTextDocumentLayout()Destructs a plain text document layout.
[override virtual]
QRectF QPlainTextDocumentLayout::blockBoundingRect(const QTextBlock &block) constReimplemented from QAbstractTextDocumentLayout::blockBoundingRect().
[override virtual protected]
void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded)Reimplemented from QAbstractTextDocumentLayout::documentChanged().
[override virtual]
QSizeF QPlainTextDocumentLayout::documentSize() constReimplemented from QAbstractTextDocumentLayout::documentSize().
[override virtual]
void QPlainTextDocumentLayout::draw(QPainter *, const
QAbstractTextDocumentLayout::PaintContext &)Reimplemented from QAbstractTextDocumentLayout::draw().
Ensures that block has a valid layout
[override virtual]
QRectF QPlainTextDocumentLayout::frameBoundingRect(QTextFrame *) constReimplemented from QAbstractTextDocumentLayout::frameBoundingRect().
[override virtual]
int QPlainTextDocumentLayout::hitTest(const QPointF &,
Qt::HitTestAccuracy) constReimplemented from QAbstractTextDocumentLayout::hitTest().
[override virtual]
int QPlainTextDocumentLayout::pageCount() constReimplemented from QAbstractTextDocumentLayout::pageCount().
Requests a complete update on all views.