title: Multi page report with QTextDocument using QTextEdit
body: <p>I created a QTextDocument with several blocks of QTextEdit handling HTML inside. I want to do page breaks only after a block ends. but I dont want to do a page break after each block. Page can having several blocks. How can I force page breaks (in HTLM or from QTextDocument)?</p>
  <pre><code>'''QPrinterInfo l_PrinterInfo = QPrinterInfo::printerInfo(p_PrinterName);
  QPrinter l_DefaultPrinter(l_PrinterInfo);
  l_DefaultPrinter.setOrientation(QPrinter::Portrait);
  l_DefaultPrinter.setResolution(QPrinter::HighResolution);
  l_DefaultPrinter.setPaperSize(QPrinter::A4);
  
  QPageSize::PageSizeId pageSizeId = l_DefaultPrinter.pageLayout().pageSize().id();
  QRectF rect = l_DefaultPrinter.pageRect(QPrinter::Millimeter);
  QSizeF rectPagePrinter(rect.width(), rect.height());
  
  QTextDocument doc;
  //set global styte to document
  doc.setDefaultStyleSheet(style);
  //set document page size
  doc.setPageSize(rectPagePrinter);
  
  QTextEdit textEdit;
  textEdit.setDocument(&amp;doc);
  //first page
  //first table block 
  textEdit.textCursor().insertHtml(htmlStringTable);
  //second imgage block
  textEdit.textCursor().insertHtml(htmlImg);
  //third pagefooter block
  textEdit.textCursor().insertHtml(pageFooter);
  //do a break page DO NOT WORK!
  QTextBlockFormat blockFormat;
  blockFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysAfter);
  textEdit.textCursor().insertBlock(blockFormat);
  
  // second page
  
  textEdit.textCursor().insertHtml(htmlStringTable2);
  textEdit.textCursor().insertHtml(htmlImgScreenShot);
  textEdit.textCursor().insertHtml(pageFooter);
  
  //send to the printer
  
  doc.print(&amp;l_DefaultPrinter);
  </code></pre>
  <p>'''</p>