title: QWebView not loading images properly
body: <p>I created an application that uses QWebView to create a template and then prints it as a pdf file.
  In the view I set a background image to the body and when excecuting the program, the first time I print the pdf, the image is not being printed in the pdf. Then, I print again the same pdf and the image appears. Thus for all the subsecuent prints.
  So, it doesn't work just for the first print.</p>
  
  <p>I debbuged the html code and the backgrund image is allways being set.</p>
  
  <p>For printing the pdf file I use this:</p>
  
  <pre><code>QPrinter printer;
  printer.setOrientation(QPrinter::Landscape);
  
  printer.setPaperSize(QSizeF(76.2,180),QPrinter::Millimeter);
  printer.setPageMargins(27,11.2,4,4.4,QPrinter::Millimeter);
  
  QPrintDialog *dialog = new QPrintDialog(&amp;printer);
  
  if (dialog-&gt;exec() == QDialog::Accepted){
      QWebView *view = new QWebView();
      QUrl url(QApplication::applicationDirPath());
      view-&gt;setHtml(cheque,url);
  
      view-&gt;print(&amp;printer);
  }
  </code></pre>
  
  <p>Where <strong>cheque</strong> is the html template</p>