PDA

View Full Version : Automatic scale of Graphics View



mirelon
12th January 2010, 21: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)

wysota
12th January 2010, 21: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().