[webkit-qt] load url using QWebPage in a thread

Ariya Hidayat ariya.hidayat at gmail.com
Tue Apr 20 06:43:13 PDT 2010

> I am trying to build a multi threaded server that loads a url in QWebPage in
> a separate thread. But I am not able to get it working. I am creating the
> QWebPage in the run method of the thread. Is this right way? How do I
> connect QWebPage's loadFinished signal to find out the page has been loaded
> (so I can do further processing, in my case, get the HTML of the loaded
> page)

You need to run an event loop. This is not QtWebKit-specific but
rather a generic Qt approach. Check for QEventLoop documentation as
well as the unit test for QWebPage (WebKit/qt/tests in the webkit
source tree) for examples and further details.

Ariya Hidayat

More information about the webkit-qt mailing list