title: QT application hangs while rendering QWebElement on QImage
body: <p>I am using QWebPage class to load a page in background in my QT application.
  Whenever it emits "repaintReqest", I try to render the contents of main frame onto a painter (QImage)
  using code like below:</p>
  
  <pre><code>QWebpage page;
  QImage m_image
  
  onRepaintRequest(){
      QMutexLocker locker(&amp;mutex);
      QPainter painter(m_image);
      page.mainFrame()-&gt;documentElement().render(&amp;painter)
  }
  </code></pre>
  
  <p>My application randomly hangs at <code>render</code> function call sometimes.<br>
  I ensure that <code>m_image</code> is not accessed by any other thread..<br>
  What could be the reason for this behavior?</p>
  
  <p>Edit:: If I call render on main frame while QWebPage is updating it internally, can that cause hang? This is something QT should handle internally.</p>