- Qt 6.10
- Qt Lottie Animation
- Qt Lottie Animation | Commercial or GPLv3

# Qt Lottie Animation

Qt Lottie Animation provides QML APIs for rendering graphics and animations in Lottie format files. These are typically exported from the Lottie plugins for Adobe After Effects.

The LottieAnimation item renders animations into an intermediate buffer using the QPainter software renderer. This may impose some performance restrictions on the sizes of illustrations, as well as on the target hardware. As an alternative, an experimental tool called lottietoqml is included. This tool converts Lottie animations to QML. As a result, they can be rendered using the hardware-accelerated renderer in Qt Quick. 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.

Finally, the VectorImage Qt Quick item can load Lottie format files directly. It converts them to QML on the fly using the lottietoqml [tech preview] functionality in a plugin.

## Getting Started

Import the types using the the following statement:

     import Qt.labs.lottieqt

## Limitations

The implementation follows the master specification for lottie. Deviations in exported Lottie files compared to the specification are taken into account as much as possible when differences are noticed.

### General limitations

- expressions are not supported
- the timeline only supports frame-mode, not time-mode

Warning: The input files for Qt Lottie Animation are assumed to be trusted content. Application developers are advised to never pass in data from untrusted sources.

### Animation level limitations

The following properties are not supported:

- `assets` - reusable text and images
- `chars` text

### Layers

The following properties are not supported:

- `ao` (auto-orientation)
- `bm` (blend mode)
- `maskProperties` (masks)
- `sr` (time stretch)

### Shapes

Some more rarely used elements and shapes are not supported, including:

- the `gstroke` (gradient stroke) element
- Nested Repeater shapes

Also note that the behavior when using multiple active trim paths (e.g. trim paths in nested groups) is unpredictable.

### Effects

The only supported effects are `Slide` and `Layer Fill`.

### Examples

- The qtlottieviewer Example demonstrates how to use the LottieAnimation item to load, display and control a Lottie file in a Qt Quick application.
- The lottietoqml Example demonstrates how the lottietoqml tool can be used to convert Lottie files into Qt Quick scenes and load these in an application.

## Licenses

Qt Lottie Animation is available under commercial licenses from The Qt Company. In addition, it is available under the GNU General Public License, version 3. See Qt Licensing for further details.

## Reference

- QML Types

## Related Information

- Lottie on GitHub