View Full Version : Automatic scale of Graphics View

12th January 2010, 22:07
I have one graphics view that fills the entire area within main window. I want to enable resizing of the window, so that the graphics view will stretch corresponding to main window. How can I manage it? (it should be simple, but googling didn't help)

12th January 2010, 22:36
The view should stretch or the scene inside it should scale? If the former then you are missing a layout in your main window's central widget. If the latter then reimplement resizeEvent for your view (or the main window, which might be easier) and call QGraphicsView::fitInView().