SVG Viewer Example

The SVG Viewer example shows how to add SVG viewing support to applications.

Scalable Vector Graphics (SVG) is an XML-based language for describing two-dimensional vector graphics. Qt provides classes for rendering and displaying SVG drawings in widgets and on other paint devices. This example allows the user to load SVG files and view them in a QGraphicsView using a QGraphicsSvgItem. Based on the selected renderer the QGraphicsView uses either a QWidget or QGLWidget as its viewport. A third render mode is also provided, where the QGraphicsView draws indirectly though a QImage. This allows testing of drawing accuracy and performance for both the native, raster, and OpenGL paint engines.

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

Example project @ code.qt.io

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.