title: QWebPage loadFinished signal not called when using thread?
body: <p>I am trying to execute a network request with webkit in a secondary thread and also do all the processing like scrapping data in the same thread. However, I am puzzled why the QWebPage's signal loadFinished is not connecting. Please enlighten me as I am still learning.</p>
  
  <pre><code>import sys
  from PyQt4.QtCore import *
  from PyQt4.QtWebKit import *
  from PyQt4.QtGui import *
  
  class HeadlessBrowser(QObject):
      def __init__(self, parent=None):
          super().__init__(parent)
          self.page = QWebPage()
  
      def browse_page(self, url):
          qDebug('method browse_page called.') #This is called.
          url = QUrl(url)
          self.page.mainFrame().load(url)
          self.page.loadFinished.connect(self.process_page) #Not executed. Why?
  
      def process_page(self):
          qDebug('method process_page called.') #This is not called. Why?
          #Convert to html
          print(self.page.mainFrame().toHtml())
  
  class WorkerThread(QThread):
      def __init__(self, parent=None):
          super().__init__(parent)
  
      def run(self):
  
          br = HeadlessBrowser()
          br.browse_page('http://www.google.com')
  
      def __del__(self):
          self.wait()
  
  def main():
      app = QApplication(sys.argv)
      thread = WorkerThread()
      thread.start()
      sys.exit(app.exec_())
  
  if __name__ == '__main__':
      main()
  </code></pre>