Unsolved QWebEngineView blocking main GUI thread when page has a GIF
-
Hello,
I have encountered a small problem. For one of my applications I wanted to load instructions through QWebViewEngine.
Overall it works fine, but when a page has even just one GIF, it keeps lagging/freezing every couple seconds. The whole widget not just the gif.
It is also present in any of the examples provided by Qt.
Here is a video demonstrating exactly the website I'm trying to load:
https://drive.google.com/file/d/0B0HZf2UyMHqKTmZ4Y1h3emc2SkU/view?usp=sharingMy guess is that, QWebEngineView uses main GUI thread for painting, hence it's lagging so badly.
Any ideas on how it can be circumvented?
Or maybe I should just give up with GIFs and use static images :( ?Kind Regards
-
@xcoder Ew that is pretty bad lag.
If you are running on linux what does
strace
say is going on during those lag spikes? It might give you some insight as to what the problem is.I haven't used web engine enough to really comment on GIFs but I think that would probably be something that was caught before release.
If you have code you want to share I can try compiling it and see if it happens on my systems or if it might be some configuration you are using or something.
-
Hola @ambershark ,
Your intutition was spot on!!!!
I just compiled on my linux machine and no lag whatsoever!
Video Here
So Ubuntu GCC 64bit Qt 5.8 and Qt 5.6 no laggingWindows 10. MSVC2015 64Bit Qt 5.8 lagging like hell (such a shame mingw is not supporting WebKits)
In any case here is an easy to compile test, I converted some of the htmls so they can be included in QRC:
Source CodeDo you reckon it is a bug?
Edit: I noticed that actually, even the good page without GIFs on windows machine lags a little bit. Barely noticable, but if you insist scrolling really quickly up and down with scroll bar. Once in a while it will go in a second long delay.
-
@xcoder Hmm, it may be a bug. If you have a reproduceable example than I would submit it and let them check it out. It could just be a webengine issue specifically with MSVC 2015 or something.
My development system with VS2015 on it is a virtual machine but I could test it and see what happens for me. I'm pretty busy right now but I'll do it later this week and let you know what I find.
-
did you guys resolve this problem now? I encountered this problem on Qt 5.15.2, when I use following setting:
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);