强制QWebView在单独的线程中下载网页内容?
我如何强制 QWebView 在单独的线程中下载网页和相关内容?
How can i force QWebView into downloading the webpage and related content in a separate thread?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你不能轻易。
您可以实现自己的 QNetworkAccessManager(请参阅 createRequest()),将工作卸载到另一个线程中的 QNetworkAccessManager。
你的具体问题是什么?
也许可以用不同的方式解决,或者可以报告 Qt 的错误?
You cannot easily.
You could implement your own QNetworkAccessManager (see createRequest()) that offloads the work to a QNetworkAccessManager in another thread.
What is your exact problem?
Maybe it can be solved differently or a bug to Qt can be reported?
现在这是默认行为,因此您可以放松并观看:)
请参阅Qt Earth Team Mix 2011 年 2 月< /a> 和 QNetworkAccessManager 的线程支持
That's now the default behaviour so you can just relax and watch :)
See Qt Earth Team Mix Feb 2011 and Threading support for QNetworkAccessManager
为什么 QWebView 在主线程加载内容时会出现问题?我的意思是,如果你这样做,主线程根本不会被锁定。
您可以有一个隐藏的 QWebView 加载内容,并在完成后显示它。
也许您应该多描述一下您的问题/想法,以帮助我们帮助您。
Why do you see a problem in having a QWebView loading content at the main thread? I mean, the main thread won't be locked at all if you do this.
You can have a hidden QWebView loading content and just when it has finished you show it.
Maybe you should describe your problem/idea a little bit more to help us help u.