[Qt-interest] load url using QWebPage in a thread
Gordon Schumacher
whiplash at pobox.com
Fri May 7 17:52:10 CEST 2010
On Tue, 20 Apr 2010 19:36:42 -0700, Jason H <scorp1us at yahoo.com> wrote:
> You didn't listen... you can't pass QWebPage to a thread and have it work [safely].
> You need to emit the HTML to the main thread for rendering. To do that, define a signal, and connect a main GUI thread handler to the thread event that is emitted.
>
Just as a clarification...
First, I am hoping that this only applies to a QWebPage that is being
displayed by a QWebView - a freestanding, mutex-protected QWebView could
be sent off to a thread without repercussions. (In other words, the
issue is that the QWebView is trying to display the QWebPage at the same
time the thread is doing something to it.)
If that is true, I would also assume that applies only to *modification*
of the QWebPage - even if it is being displayed by a QWebView. That is
to say, after the page has been loaded and thus is no longer being
changed, it would be safe to hand off a const reference to its QWebPage
to a thread.
Do I have this right?
More information about the Qt-interest-old
mailing list