SVG 查看器范例

SVG (可伸缩向量图形) 是用于描述 2D 向量图形,基于 XML 的语言。Qt 提供用于在 Widget 及其它描绘设备渲染和显示 SVG 绘制的类。此范例允许用户加载 SVG 文件并查看它们在 QGraphicsView 使用 QGraphicsSvgItem 。基于选定的渲染器 QGraphicsView 使用 QWidget or QGLWidget as its viewport. A third render mode is also provided, where the QGraphicsView 间接绘制透过 QImage . This allows testing of drawing accuracy and performance for both the native, raster, and OpenGL paint engines.

QtSvg module documentation for more information about SVG and Qt's SVG classes.

文件: