Giter Site home page Giter Site logo

wangwenx190 / qtlottie Goto Github PK

View Code? Open in Web Editor NEW
47.0 4.0 17.0 676 KB

QtLottie is a tiny C++ library that can render Adobe® After Effects™ animations exported as JSON with Bodymovin.

License: MIT License

CMake 8.06% C 2.57% C++ 89.37%
lottie bodymovin qt qml qt-widgets qt-quick

qtlottie's Introduction

QtLottie

QtLottie is a tiny C++ library that can render Adobe® After Effects™ animations exported as JSON with Bodymovin.

Features

  • Support many After Effects features (depends on the specific backend).
  • Cross-platform: support Windows (7~10), Linux and macOS.
  • Support both Qt Widgets and Qt Quick.
  • Support all versions from Qt5 to Qt6.
  • Very easy to build and use.

Build

cmake .
cmake --build .
cmake --install .

Currently QtLottie supports two backends: skottie and rlottie. QtLottie will load it dynamically at run-time. Make sure you have build it and put it in the executable's directory before you run your application. While this library is initializing, skottie is prefered over rlottie.

Usage

See examples.

Limitation

If your JSON uses assets, these files can only be placed on the disk, they can't be compressed or embeded into any container-like thing. It's caused by technical limitation, PRs are welcome.

License

MIT License

Copyright (C) 2021 wangwenx190 (Yuhang Zhao)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

qtlottie's People

Contributors

wangwenx190 avatar xspeed1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qtlottie's Issues

您好,这些绑定的信息,看您并没有实现,这些方法的实现是可以解决什么呢?

connect(m_drawEngine, &QtLottieDrawEngine::durationChanged, this, &QtLottieWidget::durationChanged);
connect(m_drawEngine, &QtLottieDrawEngine::sizeChanged, this, &QtLottieWidget::sourceSizeChanged);
connect(m_drawEngine, &QtLottieDrawEngine::loopsChanged, this, &QtLottieWidget::loopsChanged);
connect(m_drawEngine, &QtLottieDrawEngine::devicePixelRatioChanged, this, &QtLottieWidget::devicePixelRatioChanged);

比如&QtLottieWidget::sourceSizeChanged,是可以适配资源大小改变吗

在win10 vs2022+qt环境下搭建使用QtLottie出现的闪屏问题,依赖rlottie库

情况:父qwidget窗口上叠放着两个QtLottieWidget子窗口,在其中一个QtLottieWidget上覆盖透明按钮用于按钮特效,另一个用于窗口背景特效
最初使用setSource接口接入按钮clicked信号切换不同lottie的json文件实现特效状态转换效果
结果:发现频繁点击出现闪屏现象,移开透明按钮,发现是QtLottieWidget闪屏,按钮叠在另一个lottiewidget上也出会现闪屏现象
尝试:后面使用不同的QtLottieWidget,尝试qt函数show() hide() 和 QtLottie函数resume() pause()实现状态切换,闪屏情况有好转但还是会出现闪屏(频繁点击情况下)
按钮存在初始-启动-循环三个lottie动画,背景存在初始-循环两个lottie状态
尝试:MFC以前碰过类似问题处理WM_ERASEBKGND解决,但qt没找到类似方案

How to install?

"cmake --install . " doesn't work. I get this:
-- Install configuration: ""

and nothing is changed. Other project's cmake can't find it
OS: ArchLinux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.