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:

    My 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

  • Moderators

    @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 lagging

    Windows 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 Code

    Do 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.

  • Moderators

    @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.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.