qtlottieviewer 示例
在应用程序中使用 Qt XMLLottieAnimation 的示例。
该示例演示了如何在Qt Quick 应用程序中使用Qt.labs.lottieqt 模块的LottieAnimation 项直接显示和控制 Lottie 动画矢量图形文件。
概述
示例窗口的主要部分是一个矩形,其中包含一个播放 Lottie 动画的LottieAnimation 项目。
下面是一行控件。用户可以使用帧速率滑块控制动画速度,使用缩放滑块放大或缩小动画。动画可以通过 "播放/暂停 "按钮停止或重新启动。暂停时,用户可以使用 "转到帧 "滑块选择要显示的确切帧。打开 "按钮将显示一个文件对话框,允许用户选择要加载和显示的 Lottie 文件。
LottieAnimation 是QQuickPaintedItem ,采用软件光栅化矢量图形。有关在 Quick 应用程序中利用图形硬件渲染显示 Lottie 文件的其他方法,请参阅lottietoqml和VectorImage 项目。
© 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.