I did like this ...

Qt Code:
  1. QPrinter printer(QPrinter::HighResolution);
  2. printer.setOrientation(QPrinter::Landscape);
  3.  
  4. QPrintDialog dlg(&printer, this);
  5.  
  6. if (dlg.exec() == QDialog::Accepted)
  7. {
  8. // calculate the total width/height table would need without scaling
  9. const int rows = tableWidget->model()->rowCount();
  10. const int cols = tableWidget->model()->columnCount();
  11.  
  12. double totalWidth = 0.0;
  13.  
  14. for (int c = 0; c < cols; ++c)
  15. {
  16. totalWidth += tableWidget->columnWidth(c);
  17. }
  18.  
  19. double totalHeight = tableWidget->horizontalHeader()->height();
  20.  
  21. for (int r = 0; r < rows; ++r)
  22. {
  23. totalHeight += tableWidget->rowHeight(r);
  24. }
  25.  
  26.  
  27. // redirect table's painting on a pixmap
  28. QPixmap pixmap(totalWidth, totalHeight );
  29.  
  30. QPainter::setRedirected(tableWidget->horizontalHeader()->viewport(), &pixmap);
  31. QPainter::setRedirected(tableWidget->viewport(), &pixmap);
  32.  
  33. QPaintEvent event(QRect(0, 0, totalWidth, totalHeight ));
  34.  
  35. QApplication::sendEvent(tableWidget->horizontalHeader()->viewport(), &event);
  36. QApplication::sendEvent(tableWidget->viewport(), &event);
  37.  
  38. QPainter::restoreRedirected(tableWidget->horizontalHeader()->viewport());
  39. QPainter::restoreRedirected(tableWidget->viewport());
  40.  
  41.  
  42.  
  43. // print scaled pixmap
  44. QPainter painter(&printer);
  45. painter.scale(4,4);
  46. //painter.drawPixmap(printer.pageRect(), pixmap, pixmap.rect());
  47. painter.drawPixmap(printer.pageRect().topLeft(), pixmap, pixmap.rect());
  48. }
To copy to clipboard, switch view to plain text mode 

but I do not get the point..

What's wrong with that code??

Thank you for your patience

Roby