title: Print multiple QTextDocuments with QPrinter
body: <p>I need to generate a document to print for a number of objects which the user creates dynamically, and I want to print these documents. I wrote following code (generateDocument() takes a reference to the document to add html code):</p>
  
  <pre><code>QPrinter printer;
  QPrintDialog popup(&amp;printer);
  if (popup.exec() == QDialog::Accepted)
  {
      for (int i = 0; i &lt; _quiz-&gt;getSerieCount(); i++)
      {
          QTextDocument doc;
          generateDocument(doc, _quiz-&gt;getSerie(i));
          doc.print(&amp;printer);
      }
  }
  </code></pre>
  
  <p>When printing to pdf the behaviour is different in linux and windows: On linux this just prints the last generated document, and on windows it prompts to select a new pdf for every generateDocument() call.</p>
  
  <p>Am i supposed to do this differently?</p>