Originally Posted by
Lykurg
did you update your scene rect after zooming?
Yep, that did the trick, thanks! I thought QGraphicsView would do it for me, but I suppose that flag I set prevents that from happening.
In case anyone stumbles on this thread in the future, here's what I did: after setting the proper scale in the zoom function, I added
// Update the scene's bounds
QRectF rect
= scene
()->itemsBoundingRect
();
if (rect.isNull())
scene
()->setSceneRect
(QRectF(0,
0,
1,
1));
else
scene()->setSceneRect(rect);
// Update the scene's bounds
QRectF rect = scene()->itemsBoundingRect();
if (rect.isNull())
scene()->setSceneRect(QRectF(0, 0, 1, 1));
else
scene()->setSceneRect(rect);
To copy to clipboard, switch view to plain text mode
Bookmarks