描绘系统

Qt 的描绘系统使能够使用相同 API 在屏幕和打印设备上描绘,且首要基于 QPainter , QPaintDevice ,和 QPaintEngine 类。

QPainter 用于履行绘制操作, QPaintDevice 是 2 维空间的抽象,可以在其上描绘使用 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.

话题

用于描绘的类

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

QBitmap 单色 (1 位深度) 像素图
QBrush 定义 QPainter 绘制形状的填充图案
QColor 基于 RGB、HSV 或 CMYK 值的颜色
QColormap 将设备无关 QColors 映射到与设备相关像素值
QConicalGradient 用于组合 QBrush 以指定锥形渐变笔刷
QDirectPainter Direct access to the underlying hardware in Qt for Embedded Linux
QFont Specifies a font used for drawing text
QFontMetrics 字体规格信息
QFontMetricsF 字体规格信息
QGenericMatrix 表示具有 N 列和 M 行的 NxM 变换矩阵的模板类
QGradient 用于组合 QBrush 以指定渐变填充
QIcon 在不同模式和状态下的可伸缩图标
QIconEngine 用于 QIcon 渲染器的抽象基类
QIconEngineV2 用于 QIcon 渲染器的抽象基类
QImage 独立于硬件的图像表示 (允许直接访问像素数据,且可以被用作描绘设备)
QImageReader 用于从文件 (或其它设备) 读取图像的格式独立接口
QImageWriter 用于将图像写入文件 (或其它设备) 的格式独立接口
QLine 使用整数精度的 2D 向量
QLineF 使用浮点精度的 2D 向量
QLinearGradient 用于组合 QBrush 以指定线性渐变笔刷
QMargins 定义矩形的 4 边距
QMovie 采用 QImageReader 播放影片的方便类
QPaintDevice The base class of objects that can be painted
QPaintEngine QPainter 如何在给定平台绘制给定设备的抽象定义
QPainter 在 Widget 和其它描绘设备上履行低级描绘
QPainterPath 用于描绘操作的容器,使图形形状能够被构造和重用
QPainterPathStroker 用于为给定描绘器路径生成可填充轮廓
QPalette 包含各 Widget 状态的颜色组
QPen 定义 QPainter 如何绘制线条和形状的轮廓
QPicture 用于记录和重演 QPainter 命令的描绘设备
QPixmap 可以用作描绘设备的离屏图像表示
QPixmapCache 应用程序范围像素图缓存
QPlatformFontDatabase Makes it possible to customize how fonts are discovered and how they are rendered
QPlatformWindowFormat Specifies the display format of an OpenGL rendering context and if possible attributes of the corresponding QPlatformWindow
QPoint 使用整数精度定义平面点
QPointF 使用浮点精度定义平面点
QPolygon Vector of points using integer precision
QPolygonF Vector of points using floating point precision
QRadialGradient 用于组合 QBrush 以指定径向渐变笔刷
QRect 使用整数精度定义平面矩形
QRectF 使用浮点精度定义平面矩形
QRegion 为描绘器指定裁剪区域
QSize 使用整数点精度定义 2D 对象的大小
QSizeF 使用浮点精度定义 2D 对象的大小
QStylePainter 方便类用于在 Widget 内绘制 QStyle 元素
QSupportedWritingSystems 当采用内部 Qt fontdatabase (字体数据库) 注册字体时使用
QSvgGenerator 用于创建 SVG 绘制的描绘设备
QSvgRenderer 用于将 SVG 文件内容绘制到描绘设备上
QSvgWidget 用于显示 SVG (可伸缩向量图形) 文件内容的 Widget
QSymbianGraphicsSystemHelper Defines functions required by QtMultimediaKit in order to enable video rendering
QTransform 指定坐标系的 2D 变换
QVector2D 表示 2D 空间中的向量或顶点

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.