1

如果没有,那么我如何明确强制它在单独的线程中异步下载?

4

1 回答 1

2

根据以下文档QWebView::setHtml()

Sets the content of the web view to the specified html.
External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl.
The html is loaded immediately; external objects are loaded asynchronously.

同样的事情QWebView::setContent()。因此,原始 HTML 在主线程中加载,任何其他引用(图像、样式表等)在单独的线程中异步加载。

根据经验,我可以告诉它QWebView::setUrl()也是异步加载的,使用网络管理器等待原始 HTML,这将反过来加载其他引用,也是异步的。据我所知,没有办法强制 QWebView 同步行动。

于 2010-10-12T18:33:44.423 回答