lottietoqml

lottietoqml is a command line tool shipped with Qt that converts a Lottie document to a QML file. This QML file can then be used as a component in Qt Quick applications.

For a demonstration of how lottietoqml can be used in an application, see the lottietoqml Example.

The tool is currently considered to be in technical preview. It does not support the full range of features supported by Qt Lottie Animation yet, and incompatible changes should be expected.

Overview

The lottietoqml tool will convert a Lottie file to a QML file which uses Qt Quick primitives. Since the Qt Quick is hardware-accelerated, rendering the animation may perform and consume less CPU time than using the built-in software renderer in Qt Lottie Animation. In addition, Qt Quick supports scalable vector graphics, so the resulting item will be smoothly transformable as far as this is possible.

Usage

The basic usage of lottietoqml is to provide an input file and an output file: lottietoqml input.json output.qml. This will read the input.json file and convert it into the corresponding Qt Quick scene in output.qml, which can then be used as part of a Qt Quick application.

In addition, it supports the following options:

OptionDescription
–copyright-statement <string>Adds <string> as a comment at the beginning of the generated file.
-c, –curve-rendererEnables the curve renderer backend for Qt Quick Shapes. This enables smooth, antialiased shapes in the scene without multi-sampling, but at some extra cost.
-p, –optimize-pathsEnables optimization of paths before committing them to the QML file, potentially making them faster to load and render later.
–outline-stroke-modeStroke the outline (contour) of the filled shape instead of the original path.
-t, –type-name <string>In place of Shape, the output will use the type name <string> instead. This is enables using a custom item to override the default behavior of Shape items.
-v, –viewDisplay a preview of the Qt Quick item as it will be generated.

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