Paint System#
A system for painting on the screen or on print devices using the same API
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.
PySide6.QtGui.QBitmapThe QBitmap class provides monochrome (1-bit depth) pixmaps.
PySide6.QtGui.QIconThe QIcon class provides scalable icons in different modes and states.
PySide6.QtGui.QIconEngineThe QIconEngine class provides an abstract base class for QIcon renderers.
PySide6.QtGui.QImageThe QImage class provides a hardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device.
PySide6.QtGui.QImageReaderThe QImageReader class provides a format independent interface for reading images from files or other devices.
PySide6.QtGui.QImageWriterThe QImageWriter class provides a format independent interface for writing images to files or other devices.
PySide6.QtGui.QPixmapThe QPixmap class is an off-screen image representation that can be used as a paint device.
PySide6.QtGui.QGenericMatrixThe QGenericMatrix class is a template class that represents a NxM transformation matrix with N columns and M rows.
PySide6.QtGui.QVector2DThe QVector2D class represents a vector or vertex in 2D space.
PySide6.QtGui.QBrushThe QBrush class defines the fill pattern of shapes drawn by QPainter.
PySide6.QtGui.QGradientThe QGradient class is used in combination with QBrush to specify gradient fills.
PySide6.QtGui.QLinearGradientThe QLinearGradient class is used in combination with QBrush to specify a linear gradient brush.
PySide6.QtGui.QRadialGradientThe QRadialGradient class is used in combination with QBrush to specify a radial gradient brush.
PySide6.QtGui.QConicalGradientThe QConicalGradient class is used in combination with QBrush to specify a conical gradient brush.
PySide6.QtGui.QColorThe QColor class provides colors based on RGB, HSV or CMYK values.
PySide6.QtGui.QColorSpaceThe QColorSpace class provides a color space abstraction.
PySide6.QtGui.QColorTransformThe QColorTransform class is a transformation between color spaces.
PySide6.QtGui.QPagedPaintDeviceThe QPagedPaintDevice class represents a paint device that supports multiple pages.
PySide6.QtGui.QPageRangesThe QPageRanges class represents a collection of page ranges.
PySide6.QtGui.QPaintDeviceThe QPaintDevice class is the base class of objects that can be painted on with QPainter.
PySide6.QtGui.QPaintEngineThe QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.
PySide6.QtGui.QPainterThe QPainter class performs low-level painting on widgets and other paint devices.
PySide6.QtGui.QPainterPathThe QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused.
PySide6.QtGui.QPainterPathStrokerThe QPainterPathStroker class is used to generate fillable outlines for a given painter path.
PySide6.QtGui.QPdfWriterThe QPdfWriter class is a class to generate PDFs that can be used as a paint device.
PySide6.QtGui.QPenThe QPen class defines how a QPainter should draw lines and outlines of shapes.
PySide6.QtGui.QPolygonThe QPolygon class provides a list of points using integer precision.
PySide6.QtGui.QPolygonFThe QPolygonF class provides a list of points using floating point precision.
PySide6.QtGui.QRegionThe QRegion class specifies a clip region for a painter.
PySide6.QtGui.QRgba64The QRgba64 struct contains a 64-bit RGB color.
QRgbaFloatThe QRgbaFloat struct contains a four part RGBA floating-point color.
PySide6.QtGui.QTransformThe QTransform class specifies 2D transformations of a coordinate system.
PySide6.QtGui.QFontThe QFont class specifies a query for a font used for drawing text.
PySide6.QtGui.QFontMetricsThe QFontMetrics class provides font metrics information.
PySide6.QtGui.QFontMetricsFThe QFontMetricsF class provides font metrics information.
QSupportedWritingSystemsThe QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.
PySide6.QtCore.QLineThe QLine class provides a two-dimensional vector using integer precision.
PySide6.QtCore.QLineFThe QLineF class provides a two-dimensional vector using floating point precision.
PySide6.QtCore.QMarginsThe QMargins class defines the four margins of a rectangle.
PySide6.QtCore.QMarginsFThe QMarginsF class defines the four margins of a rectangle.
PySide6.QtCore.QPointThe QPoint class defines a point in the plane using integer precision.
PySide6.QtCore.QPointFThe QPointF class defines a point in the plane using floating point precision.
PySide6.QtCore.QRectThe QRect class defines a rectangle in the plane using integer precision.
PySide6.QtCore.QRectFThe QRectF class defines a finite rectangle in the plane using floating point precision.
PySide6.QtCore.QSizeThe QSize class defines the size of a two-dimensional object using integer point precision.
PySide6.QtCore.QSizeFThe QSizeF class defines the size of a two-dimensional object using floating point precision.
PySide6.QtSvg.QSvgGeneratorThe QSvgGenerator class provides a paint device that is used to create SVG drawings.
PySide6.QtSvg.QSvgRendererThe QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
PySide6.QtSvgWidgets.QSvgWidgetThe QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files.
The QPixmapFilter class provides the basic functionality for pixmap filter classes. Pixmap filter can be for example colorize or blur.
The QPixmapConvolutionFilter class provides convolution filtering for pixmaps.
The QPixmapColorizeFilter class provides colorizing filtering for pixmaps.
The QPixmapDropShadowFilter class is a convenience class for drawing pixmaps with drop shadows.
PySide6.QtWidgets.QStylePainterThe QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
PySide6.QtWidgets.QColormapThe QColormap class maps device independent QColors to device dependent pixel values.