PDA

View Full Version : How to force QGraphicsView to keep the current position when its sceneRect shrinks?



wayfaerer
13th February 2012, 02:52
When a QGraphicsScene's sceneRect grows, QGraphicsView's scrollbars automatically adjust to compensate, and the view's center point doesn't change. However, when the sceneRect shrinks in size, the center point can change to prevent showing any blank space outside of the sceneRect.

Is there a way to disable that, so that the center point never changes even when the sceneRect shrinks? I'd like the scrollbar to automatically resize, but I don't want the center point to change until the user actually moves the scrollbar. At that point it would be expected for the view to jump to the new center point.