Hi,
these are my 2 question?

1)
I have added "print to pdf" to my program; here the function:

Qt Code:
  1. void MainWindow::printToPdf()
  2. {
  3. QPrinter printer;
  4. printer.setOrientation(QPrinter::Portrait);
  5. printer.setOutputFileName("test.pdf");
  6. printer.setOutputFormat(QPrinter::PdfFormat);
  7.  
  8. QImage image(700,1000,QImage::Format_ARGB32);
  9.  
  10. QPainter painter;
  11. painter.setRenderHint(QPainter::Antialiasing, true);
  12. painter.begin(&image);
  13. // Draw some text to image
  14. painter.end();
  15.  
  16. p.begin(&printer);
  17. p.drawImage(0, 0, image);
  18. p.end();
  19. }
To copy to clipboard, switch view to plain text mode 

When I click the first time on the print button the pdf is created in the right way, but if I click a second time the resulting pdf shows some ugly effects: or the contents of the two print actions overlaps or are present some black dots and lines (apart from the desired text).

I have also added delete &painter, delete &printer, delete &image at the end of the above code but I got segmentation fault calling the print function.

2)
If I have two qimage is it possible print a pdf with two pages, one for each qimage?

Thanks