描绘系统

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

QPainter is used to perform drawing operations, QPaintDevice is an abstraction of a two-dimensional space that can be painted on using a QPainter ,和 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

这些类提供在描绘设备上进行描绘的支持。

QBitmap

Monochrome (1-bit depth) pixmaps

QBrush

定义 QPainter 绘制形状的填充图案

QColor

基于 RGB、HSV 或 CMYK 值的颜色

QColormap

Maps device independent QColors to device dependent pixel values

QConicalGradient

Used in combination with QBrush to specify a conical gradient brush

QFont

Specifies a font used for drawing text

QFontMetrics

字体规格信息

QFontMetricsF

字体规格信息

QGenericMatrix

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

QGradient

Used in combination with QBrush to specify gradient fills

QIcon

在不同模式和状态下的可缩放图标

QIconEngine

用于 QIcon 渲染器的抽象基类

QImage

独立于硬件的图像表示 (允许直接访问像素数据,且可以被用作描绘设备)

QImageReader

Format independent interface for reading images from files or other devices

QImageWriter

Format independent interface for writing images to files or other devices

QLine

Two-dimensional vector using integer precision

QLineF

Two-dimensional vector using floating point precision

QLinearGradient

Used in combination with QBrush to specify a linear gradient brush

QMargins

定义矩形的 4 边距

QMarginsF

定义矩形的 4 边距

QPagedPaintDevice

Represents a paintdevice that supports multiple pages

QPaintDevice

可以采用 QPainter 进行描绘的对象的基类

QPaintEngine

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

QPainter

在 Widget 和其它描绘设备上,履行低级描绘

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

定义 QPainter 如何绘制线条和形状的轮廓

QPixmap

可以用作描绘设备的离屏图像表示

QPoint

使用整数精度定义平面点

QPointF

使用浮点精度定义平面点

QPolygon

Vector of points using integer precision

QPolygonF

Vector of points using floating point precision

QRadialGradient

Used in combination with QBrush to specify a radial gradient brush

QRect

使用整数精度定义平面矩形

QRectF

Defines a rectangle in the plane using floating point precision

QRegion

为描绘器指定裁剪区域

QRgba64

Struct contains a 64-bit RGB color

QSize

Defines the size of a two-dimensional object using integer point precision

QSizeF

Defines the size of a two-dimensional object using floating point precision

QStylePainter

Convenience class for drawing QStyle elements inside a widget

QSupportedWritingSystems

当采用内部 Qt fontdatabase (字体数据库) 注册字体时使用

QSvgGenerator

Paint device that is used to create SVG drawings

QSvgRenderer

Used to draw the contents of SVG files onto paint devices

QSvgWidget

Widget that is used to display the contents of Scalable Vector Graphics (SVG) files

QTransform

Specifies 2D transformations of a coordinate system

QVector2D

Represents a vector or vertex in 2D space