qwebview/qwebpage是否在单独的线程或主/GUI线程中下载内容?
题
如果不是这样,那么我如何才能明确迫使它在分离的线程中异步下载?
解决方案
根据 文档 为了 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()
. 。因此,将RAW HTML加载到主线程中,并且任何其他引用(图像,样式表等)都在单独的线程中异步加载。
从经验中,我可以说 QWebView::setUrl()
同样,使用网络管理器等待RAW HTML,同步加载,这又将加载其他参考文献,也是异步的。据我所知,没有办法强迫Qwebview sychcroned。
不隶属于 StackOverflow