Hi, I have this simple code:

Qt Code:
  1. QPrinter *printer;
  2. QPageSetupDialog *pageSetup;
  3.  
  4. //(those two variables are initialized in constructor method of CardManager)
  5.  
  6. void CardManager::printSetup()
  7. {
  8. pageSetup = new QPageSetupDialog(printer, this);
  9. pageSetup->exec();
  10. }
  11.  
  12. void CardManager::print()
  13. {
  14. QPrintDialog *printDialog = new QPrintDialog(printer, this);
  15. if (printDialog->exec() == QDialog::Accepted)
  16. {
  17. QTextDocument *document = new QTextDocument();
  18. QString html = "something";
  19. document->setHtml(html);
  20. document->print(printer);
  21. }
  22. }
To copy to clipboard, switch view to plain text mode 

When I setup paper size by printSetup() and then call print(), the paper size (meaning A4, A5 etc.) is remembered. But when I setup page margins by printSetup() and then call print(), margins are set to their default values (and so not remembered how they were set up by printSetup()). Any help with that?