Home · All Classes · All Functions · Overviews

The 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.


Classes for Painting

These classes provide support for painting onto a paint device.

QBitmapMonochrome (1-bit depth) pixmaps
QBrushDefines the fill pattern of shapes drawn by QPainter
QColorColors based on RGB, HSV or CMYK values
QColormapMaps device independent QColors to device dependent pixel values
QConicalGradientUsed in combination with QBrush to specify a conical gradient brush
QDirectPainterDirect access to the underlying hardware in Qt for Embedded Linux
QFontSpecifies a font used for drawing text
QFontMetricsFont metrics information
QFontMetricsFFont metrics information
QGenericMatrixTemplate class that represents a NxM transformation matrix with N columns and M rows
QGradientUsed in combination with QBrush to specify gradient fills
QIconScalable icons in different modes and states
QIconEngineAbstract base class for QIcon renderers
QIconEngineV2Abstract base class for QIcon renderers
QImageHardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device
QImageReaderFormat independent interface for reading images from files or other devices
QImageWriterFormat independent interface for writing images to files or other devices
QLineTwo-dimensional vector using integer precision
QLineFTwo-dimensional vector using floating point precision
QLinearGradientUsed in combination with QBrush to specify a linear gradient brush
QMarginsDefines the four margins of a rectangle
QMovieConvenience class for playing movies with QImageReader
QPaintDeviceThe base class of objects that can be painted
QPaintEngineAbstract definition of how QPainter draws to a given device on a given platform
QPainterPerforms low-level painting on widgets and other paint devices
QPainterPathContainer for painting operations, enabling graphical shapes to be constructed and reused
QPainterPathStrokerUsed to generate fillable outlines for a given painter path
QPaletteContains color groups for each widget state
QPenDefines how a QPainter should draw lines and outlines of shapes
QPicturePaint device that records and replays QPainter commands
QPixmapOff-screen image representation that can be used as a paint device
QPixmapCacheApplication-wide cache for pixmaps
QPointDefines a point in the plane using integer precision
QPointFDefines a point in the plane using floating point precision
QPolygonVector of points using integer precision
QPolygonFVector of points using floating point precision
QRadialGradientUsed in combination with QBrush to specify a radial gradient brush
QRectDefines a rectangle in the plane using integer precision
QRectFDefines a rectangle in the plane using floating point precision
QRegionSpecifies a clip region for a painter
QSizeDefines the size of a two-dimensional object using integer point precision
QSizeFDefines the size of a two-dimensional object using floating point precision
QStylePainterConvenience class for drawing QStyle elements inside a widget
QSvgGeneratorPaint device that is used to create SVG drawings
QSvgRendererUsed to draw the contents of SVG files onto paint devices
QSvgWidgetWidget that is used to display the contents of Scalable Vector Graphics (SVG) files
QTransformSpecifies 2D transformations of a coordinate system
QVector2DRepresents a vector or vertex in 2D space

Alternatively, Qt provides the QtOpenGL module, offering classes that makes it easy to use OpenGL in Qt applications. Among others, the module provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where the OpenGL API can be used to render the contents.

Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.6.3