Paint System

Qt's paint system enables painting on screen and print devices using the same API, and is primarily based on the QPainter, QPaintDevice, and QPaintEngine classes.

QPainter is used to perform drawing operations, QPaintDevice is an abstraction of a two-dimensional space that can be painted on using a QPainter, and QPaintEngine provides the interface that the painter uses to draw onto different types of devices. The QPaintEngine class is used internally by QPainter and QPaintDevice, and is hidden from application programmers unless they create their own device type.

The main benefit of this approach is that all painting follows the same painting pipeline making it easy to add support for new features and providing default implementations for unsupported ones.

Topics

Classes for Painting

These classes provide support for painting onto a paint device.

QLine

The QLine class provides a two-dimensional vector using integer precision.

QLineF

The QLineF class provides a two-dimensional vector using floating point precision.

QMargins

The QMargins class defines the four margins of a rectangle.

QPoint

The QPoint class defines a point in the plane using integer precision.

QPointF

The QPointF class defines a point in the plane using floating point precision.

QRect

The QRect class defines a rectangle in the plane using integer precision.

QRectF

The QRectF class defines a rectangle in the plane using floating point precision.

QSize

The QSize class defines the size of a two-dimensional object using integer point precision.

QSizeF

The QSizeF class defines the size of a two-dimensional object using floating point precision.

QSvgGenerator

The QSvgGenerator class provides a paint device that is used to create SVG drawings.

QSvgRenderer

The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.

QSvgWidget

The QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files.

QStylePainter

The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.

QColormap

The QColormap class maps device independent QColors to device dependent pixel values.

Groups Of Related Classes

If you know what kind of class you want (GUI, painting, I.O, etc), look here.

QBitmap

Monochrome (1-bit depth) pixmaps

QIcon

Scalable icons in different modes and states

QIconEngine

Abstract base class for QIcon renderers

QImage

Hardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device

QImageReader

Format independent interface for reading images from files or other devices

QImageWriter

Format independent interface for writing images to files or other devices

QPixmap

Off-screen image representation that can be used as a paint device

QGenericMatrix

Template class that represents a NxM transformation matrix with N columns and M rows

QVector2D

Represents a vector or vertex in 2D space

QBrush

Defines the fill pattern of shapes drawn by QPainter

QGradient

Used in combination with QBrush to specify gradient fills

QLinearGradient

Used in combination with QBrush to specify a linear gradient brush

QRadialGradient

Used in combination with QBrush to specify a radial gradient brush

QConicalGradient

Used in combination with QBrush to specify a conical gradient brush

QColor

Colors based on RGB, HSV or CMYK values

QPagedPaintDevice

Represents a paintdevice that supports multiple pages

QPaintDevice

The base class of objects that can be painted on with QPainter

QPaintEngine

Abstract definition of how QPainter draws to a given device on a given platform

QPainter

Performs low-level painting on widgets and other paint devices

QPainterPath

Container for painting operations, enabling graphical shapes to be constructed and reused

QPainterPathStroker

Used to generate fillable outlines for a given painter path

QPdfWriter

Class to generate PDFs that can be used as a paint device

QPen

Defines how a QPainter should draw lines and outlines of shapes

QPolygon

Vector of points using integer precision

QPolygonF

Vector of points using floating point precision

QRegion

Specifies a clip region for a painter

QTransform

Specifies 2D transformations of a coordinate system

QFont

Specifies a font used for drawing text

QFontMetrics

Font metrics information

QFontMetricsF

Font metrics information

QSupportedWritingSystems

Used when registering fonts with the internal Qt fontdatabase

QPlatformFontDatabase

Makes it possible to customize how fonts are discovered and how they are rendered

Notes provided by the Qt Community

No notes