You only need to compute the right scale factor, according to the size of the widget,.

try something like this :

Qt Code:
  1. void YourGraphicsView::resizeEvent ( QResizeEvent * event ) {
  2.  
  3. QGraphicsView::resizeEvent(event);
  4.  
  5. const QSize& oldSize = event->oldSize();
  6. const QSize& newSize = event->size();
  7.  
  8. //be aware of integer division and division by zero
  9. double scaleFactorX = (oldSize.width ()>0) ? ((double)newSize.width())/oldSize.width ():1;
  10. double scaleFactorY = (oldSize.height()>0) ?((double)newSize.height())/oldSize.height():1;
  11.  
  12. //sclae the view
  13. scale(scaleFactorX, scaleFactorY);
  14. }
To copy to clipboard, switch view to plain text mode 

But I am not sure that the behaviour will be correct for all cases.