IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Detailed Description

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

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

  • Header: PaintContext

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

Detailed Description

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.

See Also

Member Variable Documentation

 

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.

The default value is -1.

QPalette PaintContext::palette

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

The default value is the application's default palette.

QList<QAbstractTextDocumentLayout::Selection> PaintContext::selections

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

The default value is an empty list indicating no selection.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+