The easiest way is to simply scale the view using QGraphicsView::fitInView() called from within resizeEvent of the view.
The easiest way is to simply scale the view using QGraphicsView::fitInView() called from within resizeEvent of the view.
it seems to work.
Qt Code:
GraphicsView->fitInView( scene->sceneRect(), Qt::KeepAspectRatio );To copy to clipboard, switch view to plain text mode
Thanks a lot
Hi,
this time, when I drew 1000 squares grid with 1pixel each square, this doesn't fit in my GraphicsView,
I got blank scene... my screen resolution is around 1000 pixels, if I reduced to 800 squares, I got all my grid back.
What I don't understand is I can't draw more than 1000 pixels whatever my GraphicsView's size...
bellow 800 squares fit correctly in 300pixels GraphicsView's size
with 1000 squares all I got is blank even with 900 pixels GraphicsView's size(with my view expanded at maximum)
800.PNG
Any tips please ?
Last edited by phenom64; 9th May 2014 at 09:39.
Please provide a minimal compilable example reproducing the problem.
Bookmarks