PaintContext Class

( QAbstractTextDocumentLayout::PaintContext )

The QAbstractTextDocumentLayout::PaintContext 類是定義使用參數的方便類,當描繪文檔布局時。 更多...

頭: #include <PaintContext>
qmake: QT += gui

公共變量

QRectF clip
int cursorPosition
QPalette palette
QVector<Selection> selections

詳細描述

The QAbstractTextDocumentLayout::PaintContext 類是定義使用參數的方便類,當描繪文檔布局時。

A paint context is used when rendering custom layouts for QTextDocuments with the QAbstractTextDocumentLayout::draw () function. It is specified by a cursor position , default text color , clip rectangle and a collection of selections .

另請參閱 QAbstractTextDocumentLayout .

成員變量文檔編製

QRectF PaintContext:: clip

This variable holds a hint to the layout specifying the area around paragraphs, frames or text require painting.

Everything outside of this rectangle does not need to be painted.

Specifying a clip rectangle can speed up drawing of large documents significantly. Note that the clip rectangle is in document coordinates (not in viewport coordinates). It is not a substitute for a clip region set on the painter but merely a hint.

The default value is a null rectangle indicating everything needs to be painted.

int PaintContext:: cursorPosition

This variable holds the position within the document, where the cursor line should be drawn.

默認值為 -1。

QPalette PaintContext:: palette

This variable holds the default color that is used for the text, when no color is specified.

默認值為應用程序的默認調色闆。

QVector < Selection > PaintContext:: selections

This variable holds the collection of selections that will be rendered when passing this paint context to QAbstractTextDocumentLayout 's draw () 函數。

The default value is an empty vector indicating no selection.