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.
Import the types using the the following statement:
import Qt.labs.lottieqt
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.
警告: 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.
The following properties are not supported:
assets
- reusable text and images
chars
text
The following properties are not supported:
ao
(auto-orientation)
bm
(融合模式)
maskProperties
(遮罩)
sr
(时间拉伸)
Some more rarely used elements and shapes are not supported, including:
gstroke
(gradient stroke) element
Also note that the behavior when using multiple active trim paths (e.g. trim paths in nested groups) is unpredictable.
The only supported effects are
Slide
and
Layer Fill
.
Qt Lottie Animation is available under commercial licenses from Qt 公司 。此外,它是可用的根据 GNU GPL (一般公共许可) 第 3 版 。见 Qt 许可 进一步了解细节。