且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Qt C ++ QWebView导致GUI运行缓慢。

更新时间:2023-11-14 19:35:22

我不能说在使用 QWebView ,即使在相当弱的SBCs。我想知道是否还有其他事情正在减缓你的下降。

I can't say I've ever had any appreciable slowdown of the rest of a user interface when using QWebView, even on quite underpowered SBCs. I wonder if there's something else going on that's slowing you down.

您加载的所有网页,或只是某些网页时,是否会遇到此问题?

Are you getting this problem with all pages you load, or just certain ones?

可以访问设置对象( QWebSettings $)的实例c $ c> )为您的 QWebView 使用 QWebView :: settings()。我建议禁用JS开始( QWebSettings :: setAttribute(JavascriptEnabled,false)),只是为了看看你是否被任何脚本您尝试显示的页面。

One idea: you can access the settings object (an instance of QWebSettings) for your QWebView using QWebView::settings(). I'd recommend disabling JS to start with (QWebSettings::setAttribute(JavascriptEnabled, false)), just to see if you're being slowed down by any scripts running behind the page you're trying to display.