Hi all,

I'm having troubles stretching QGraphicsViews automatically when the size of my window adjusts.

This is the code I have at the moment.
Qt Code:
  1. self.leftview = QtGui.QGraphicsView()
  2. self.rightview = QtGui.QGraphicsView()
  3.  
  4. self.leftview.setFixedSize(550,600)
  5. self.rightview.setFixedSize(550,600)
  6.  
  7. leftrect = QtCore.QRectF(self.leftview.rect())
  8. rightrect = QtCore.QRectF(self.rightview.rect())
  9. leftrect.adjust(1,1,-1,-1)
  10. rightrect.adjust(1,1,-1,-1)
  11.  
  12. self.leftscene = TEMDrawer.DiagramScene(leftrect)
  13. self.rightscene = TEMDrawer.DiagramScene(rightrect)
  14.  
  15. self.leftview.setScene(self.leftscene)
  16. self.rightview.setScene(self.rightscene)
To copy to clipboard, switch view to plain text mode 

The constructor of the DiagramScene calls the setSceneRect with the given parameter.
No GUI-related stuff other than that happens in the DiagramScene class.

Removing the setFixedSize() method calls do not enable automatic stretching of the QGraphicsView or QGraphicsScene.

Is there a way to automatically stretch a QGraphicsScene or QGraphicsView to fit the space the layout uses?

Thanks in advance!

PS: I had a look at the proposed threads #1#2#3, but they did not offer a solution for my problem...