Solved QGraphicsView reach outside scene
-
Hi,
I have a QGraphicsScene which I have added some rectangles. The QGraphicsView is able to display them with the horizontal and vertical scrollbars such that the view can only scroll to the leftmost/rightmost uppermost/lowermost rectangle. but i want the QGraphicsView to be able to scroll a distance far from the leftmost/rightmost, etc. How do I achieve that? -
You need to enlarge your
QGraphicsScene
. TheQGraphicsView
just the view of a specific part of your scene.If you increase your scene's width and height, you can scroll to empty areas (where you dont have any rectangles)
-
Yes that worked, by using setSceneRect.
Thanks