SVG 查看器范例展示如何向应用程序添加 SVG 查看支持。
![]()
SVG (可伸缩向量图形) 是用于描述 2D 向量图形,基于 XML 的语言。Qt 提供用于在 Widget 及其它描绘设备渲染和显示 SVG 绘制的类。此范例允许用户加载 SVG 文件并查看它们在
QGraphicsView使用QGraphicsSvgItem。基于选定的渲染器QGraphicsView使用QWidgetorQGLWidgetas its viewport. A third render mode is also provided, where theQGraphicsView间接绘制透过QImage。这允许测试本机、光栅及 OpenGL 描绘引擎的绘制精度和性能。See the Qt SVG module documentation for more information about SVG and Qt’s SVG classes.