Qt 4.8
Public Functions | Public Variables | List of all members
QAbstractTextDocumentLayout::PaintContext Class Reference

The QAbstractTextDocumentLayout::PaintContext class is a convenience class defining the parameters used when painting a document's layout. More...

#include <qabstracttextdocumentlayout.h>

Public Functions

 PaintContext ()
 

Public Variables

QRectF clip
 a hint to the layout specifying the area around paragraphs, frames or text require painting. More...
 
int cursorPosition
 the position within the document, where the cursor line should be drawn. More...
 
QPalette palette
 the default color that is used for the text, when no color is specified. More...
 
QVector< Selectionselections
 the collection of selections that will be rendered when passing this paint context to QAbstractTextDocumentLayout's draw() function. More...
 

Detailed Description

The QAbstractTextDocumentLayout::PaintContext class is a convenience class defining the parameters used when painting a document's layout.

Note
This class or function is reentrant.

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

See also
QAbstractTextDocumentLayout

Definition at line 77 of file qabstracttextdocumentlayout.h.

Constructors and Destructors

◆ PaintContext()

QAbstractTextDocumentLayout::PaintContext::PaintContext ( )
inline
Warning
This function is not part of the public interface.

Definition at line 79 of file qabstracttextdocumentlayout.h.

80  : cursorPosition(-1)
81  {}
int cursorPosition
the position within the document, where the cursor line should be drawn.

Properties

◆ clip

QAbstractTextDocumentLayout::PaintContext::clip

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.

Definition at line 84 of file qabstracttextdocumentlayout.h.

Referenced by QTextDocumentLayout::draw(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocument::drawContents(), QTextControl::drawContents(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawFrame(), and printPage().

◆ cursorPosition

QAbstractTextDocumentLayout::PaintContext::cursorPosition

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

The default value is -1.

Definition at line 82 of file qabstracttextdocumentlayout.h.

Referenced by QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawFrame(), QTextControl::getPaintContext(), and QPlainTextEdit::paintEvent().

◆ palette

QAbstractTextDocumentLayout::PaintContext::palette

◆ selections

QAbstractTextDocumentLayout::PaintContext::selections

the collection of selections that will be rendered when passing this paint context to QAbstractTextDocumentLayout's draw() function.

The default value is an empty vector indicating no selection.

Definition at line 85 of file qabstracttextdocumentlayout.h.

Referenced by adjustContextSelectionsForCell(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawFrame(), QTextControl::getPaintContext(), and QPlainTextEdit::paintEvent().


The documentation for this class was generated from the following files: