What is your scene's rectangle?
For example QRect(0,0,2000,500)
I'd like to keep the center (whereever it is) when I zoom out. However, as it is now, on zooming out when the upper left corner reaches 0,0 the AnchorViewCenter breaks -> it keeps 0,0 at top left causing the whole view to slide. If I do a setSceneRect() with extreme values, or insert dummy QGraphicsItems on the corners of the zoomed out view, it works, but that's an ugly workaround![]()
What happens if you call:
?Qt Code:
view->fitInView(view->sceneRect());To copy to clipboard, switch view to plain text mode
Bookmarks