Vector Image Formats in Qt

Qt supports many standard file formats for loading graphical data, allowing applications to import content produced in other tools.

This article focuses on vector images, and which considerations to take when producing vector graphics content for use in a Qt application.

Note: For general information on Qt's support for 2D graphics, see the 2D Graphics in Qt documentation.

File Format: SVG

SVG files can be loaded in two different ways in Qt Quick: Either as a software-rasterized image using the Image component or using hardware-accelerated rendering with VectorImage (including converting the file ahead of time using svgtoqml.)

In addition, QSvgRenderer provides general access to the software rasterizer. QSvgWidget and QGraphicsSvgItem provide convenience APIs for integrating SVG content in Qt Widgets applications.

As a baseline, Qt supports the static features of the SVG 1.2 Tiny profile. A detailed list of the features supported by this profile is available in the SVG 1.2 Tiny specification.

In addition, some extended features are supported. These are currently only supported by the software rasterizer and not the hardware-accelerated renderer in VectorImage or svgtoqml.

Interactive features of SVG are not supported, but interaction can easily be implemented in either Qt Quick or Qt Widgets. Some specific animation types are also supported, using either the SMIL format or CSS keyframes.

Here follows a high-level list of supported and unsupported features to give an overview of what to expect. Unsupported features will be ignored as far as it is possible, so that SVG files that depend on unsupported features will still show, but they may have omissions or errors.

High-level FeatureSoftware RasterizerVectorImageComment
TransformationsYesYes
Basic shapesYesYesCircles, rectangles, ellipses, lines, polylines and polygons
Arbitrary shapesYesYesComposite paths built from arbitrary bezier curves and lines.
Raster imagesYesYesBoth embedded and stored on file system
IndirectionsYesYesSpecifically the "use" element
Conditional processingYesYesSpecifically the "switch" element
Simple text layoutsYesYes
Embedded fontsYesYes
Solid color fillsYesYes
Gradient fillsYesYes
Customizable strokesYesYesCustomizable width, line caps, line joins, and dashes
Cosmetic strokesYesNoOutlines that do not scale with the view
Gradient strokesYesYes
MultimediaNoNo
ScriptingNoNo
LinkingNoNo

In addition, the following extended features are supported from SVG 1.1 and SVG 2.0:

High-level FeatureSoftware RasterizerVectorImageComment
MasksYesNo
Clip pathsNoNo
PatternsYesNo
MarkersYesNo
Reusable symbolsYesNo
Post-processing filtersYesNofeColorMatrix, feFlood, feGaussianBlur, feOffset and feMerge.

And finally, the following property animations are supported (animations not listed here are currently unsupported). Animations should be exported in the CSS keyframes format for best results.

Animation FeatureSoftware RasterizerVectorImageComment
Transform animationsYesYes
Color animationsYesYes
Opacity animationsYesYes

File Format: Lottie

Similarly to SVG, there are different ways of loading files in the Lottie format in Qt.

The LottieAnimation type loads an image and displays it using a software rasterizer, much like QSvgRenderer does for SVG.

In addition, hardware accelerated rendering is possible using VectorImage and the lottietoqml tool. These are currently in tech preview state.

In order to use Lottie files with VectorImage, the vectorimageformats plugin included with the Qt Lottie Animation module must be deployed together with the application. In addition, the assumeTrustedSource property of the VectorImage must be set to true.

The lottietoqml tool can be used to pre-convert Lottie source files to QML. An example of this can be found in the lottietoqml Example.

The following is a list of the high-level features supported by the LottieAnimation type (software rasterizer) and VectorImage (also including pre-converting files using lottietoqml.)

High-level FeatureLottieAnimationVectorImageComment
TransformationsYesYes
ShapesYesYes
Solid fillsYesYes
Gradient fillsYesYes
Customizable strokesYesYesCustomizable width, line caps, line joins, and dashes
Gradient strokesNoNo
Image layersYesYesEmbedded data only
Precomposition layersYesYes
Path trimmingYesYes
MattesYesNo
MasksNoNo
RepeatersYesNo
Layer effectsFill effect onlyNo
Text layersNoNo
MultimediaNoNoAudio and camera layers not supported.
ExpressionsNoNo
3D LayersNoNo
Time remappingNoNo

In principle, almost any property in the Lottie format can be animated. For extensive support of animatable properties, use LottieAnimation. The VectorImage type (and lottietoqml) provides support for a selected subset of properties that are commonly used to create animations.

High-level FeatureLottieAnimationVectorImageComment
Transform animationsYesYes
Path trim animationsYesYes
Color animationsYesYes
Opacity animationsYesYes
Path animationsYesNoMorphing animations of control points of shapes.
Other property animationsYesNo

File Format: Font Files as a Vector Image Format

In addition to conventional format for vector graphics, like SVG, it is also possible to utilize custom font files where vector graphics assets are stored as glyphs.

This has the advantage that simple illustrations can be inlined in text labels, with typographical properties similar to text. This, in turn, that can make the alignment of the images with text easier.

Using font files for this purpose can also be a convenient way to distribute large icon libraries, as well as providing themes that can be replaced at run-time.

However, font use in Qt is optimized for producing text, so there are some considerations when using icon fonts as an alternative to specialized vector image components like VectorImage.

First of all, color fonts will always be pre-rasterized at the specified pixel size. This means that applying transforms to such text items will cause scaling artifacts. For illustrations that require zooming for instance, using VectorImage is preferable.

Using the specialized components is also preferable for any animated vector image. While the variable font format extension makes morphing animations possible, this is not the use the font system in Qt is optimized for. Therefore, animating the variable axes of a font will be less efficient than using another vector image format.

So for animated and/or multi-color vector images, using a format such as SVG should typically be preferred. For single-color, static ones, using a font is an option with certain conveniences.

© 2025 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.