title: Qt output pdf is empty
body: <p>I used the most simplistic code I could find on Qt pdf printing, and it works fine without any errors. However when I attempt to open the produced pdf it complains that the pdf is empty and cant be opened. I have no clue as to what aspect of the code is wrong OR possibly outdated ? I though it might be a permission issue, but the pdf file is being created though. Below is the code is used:</p>
  
  <p><strong>UPDATE FULL CODE</strong></p>
  
  <pre><code> #include &lt;QCoreApplication&gt;
   #include &lt;QPrinter&gt;
   #include &lt;QTextDocument&gt; 
  
  int main(int argc, char *argv[])
  {
   QCoreApplication a(argc, argv);
  
   QTextDocument doc;
   doc.setHtml( "&lt;p&gt;A QTextDocument can be used to present formatted text "
                "in a nice way.&lt;/p&gt;"
                "&lt;p align=center&gt;It can be &lt;b&gt;formatted&lt;/b&gt; "
                "&lt;font size=+2&gt;in&lt;/font&gt; &lt;i&gt;different&lt;/i&gt; ways.&lt;/p&gt;"
                "&lt;p&gt;The text can be really long and contain many "
                "paragraphs. It is properly wrapped and such...&lt;/p&gt;" );
    QPrinter printer;
    printer.setOutputFileName("../out.pdf");
    printer.setOutputFormat(QPrinter::PdfFormat);
    doc.print(&amp;printer);
    printer.newPage();
  
   return 0;
  </code></pre>
  
  <p>}</p>