Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DremirVRain opened this issue Apr 27, 2022 · 1 comment

Comments

@DremirVRain
Copy link

DremirVRain commented Apr 27, 2022

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

@DremirVRain
Copy link
Author

DremirVRain commented Apr 27, 2022

后面使用
new_lottie_controller.show();
QTimer::singleShot(DELAY_TIME, this {
last_lottie_controller.hide();
});
显示其他状态lottie控件,延时隐藏当前lottie控件的方法解决闪屏问题了,延时时间过低也会闪屏,设置50ms后完全没有闪屏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant