Using Qt C ++ QWebView makes the GUI work slowly.

When the page loads through QWebView, I noticed that other program elements start to run slowly, in particular the GUI.

What is the best solution to solve this problem?

+2
c ++ qt qwebview
source share
2 answers

I can’t say that I have ever experienced a noticeable slowdown in the rest of the user interface when using QWebView , even on fairly weak SBCs. I wonder if there is anything else that slows you down.

Are you getting this problem with all the pages you load, or only with specific ones?

One idea: you can access the settings object ( QWebSettings instance) for QWebView using QWebView::settings() . I would recommend disabling JS to start with ( QWebSettings::setAttribute(JavascriptEnabled, false) ), just to make sure that you are slowed down by any scripts running behind the page you are trying to display.

+1
source share

I have the same problem, and this is due to the fact that several QWebViews are visible (in my case 2-3) and have JavaScript elements that slowly display (for example, Raphael elements or a ckeditor document). Since QWebKit must be run from the main thread, any slowdowns in rendering a webpage slows down the rest of the GUI user interaction. Currently I do not know how to solve this. This is disappointing that QWebView cannot be placed in another thread.

0
source share

All Articles