The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument . 更多...
头: | #include <QPlainTextDocumentLayout> |
qmake: | QT += widgets |
Since: | Qt 4.4 |
继承: | 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 |
const QMetaObject | staticMetaObject |
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 。见 QTextDocument::setDocumentLayout ().
QPlainTextDocumentLayout 使用 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.
此特性指定光标的宽度 (以像素为单位)。默认值为 1。
访问函数:
int | cursorWidth () const |
void | setCursorWidth (int width ) |
构造纯文本文档布局为文本 document .
[虚拟]
QPlainTextDocumentLayout::
~QPlainTextDocumentLayout
()
销毁纯文本文档布局。
[override virtual]
QRectF
QPlainTextDocumentLayout::
blockBoundingRect
(const
QTextBlock
&
block
) const
重实现自 QAbstractTextDocumentLayout::blockBoundingRect ().
[override virtual protected]
void
QPlainTextDocumentLayout::
documentChanged
(
int
from
,
int
charsRemoved
,
int
charsAdded
)
重实现自 QAbstractTextDocumentLayout::documentChanged ().
[override virtual]
QSizeF
QPlainTextDocumentLayout::
documentSize
() const
重实现自 QAbstractTextDocumentLayout::documentSize ().
[override virtual]
void
QPlainTextDocumentLayout::
draw
(
QPainter *
,
const QAbstractTextDocumentLayout::PaintContext &
)
重实现自 QAbstractTextDocumentLayout::draw ().
Ensures that block has a valid layout
[override virtual]
QRectF
QPlainTextDocumentLayout::
frameBoundingRect
(
QTextFrame *
) const
重实现自 QAbstractTextDocumentLayout::frameBoundingRect ().
[override virtual]
int
QPlainTextDocumentLayout::
hitTest
(
const QPointF &
,
Qt::HitTestAccuracy
) const
重实现自 QAbstractTextDocumentLayout::hitTest ().
[override virtual]
int
QPlainTextDocumentLayout::
pageCount
() const
重实现自 QAbstractTextDocumentLayout::pageCount ().
请求对所有视图,进行完整更新。