I have a QGraphicsView application that handles drawing lines between nodes. The nodes represent holes that will be drilled into a test fixture and the lines are wires between the nodes. I am trying to print out just the nodes, so that the printout can be affixed over the actual test fixture.

The problem I'm having is that when I run the following code:

Qt Code:
  1. void GraphicsViewer::Print()
  2. {
  3. QPrinter printer( QPrinter::ScreenResolution );
  4. printer.setPageSize( QPrinter::Letter );
  5. printer.setOrientation( QPrinter::Portrait );
  6.  
  7. QPrintDialog dialog( &printer, this );
  8. if( dialog.exec() == QDialog::Accepted )
  9. {
  10. QPainter painter(&printer);
  11. GetGraphicsView()->scene()->render( &painter );
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

The printout is scaled to fit the page because of the aspectRatioMode argument to the render function. How do I tell the render function that I do not want to scale to fit the page, and I want a true what you see is what you get representation of my QGraphicsScene on the paper?