How to view all items contained in QGraphicsScene?
is there an easy way to zoom the scene so, that all items are visible? looks like a simple task, but I'a开发者_开发问答m sitting since an hour on it. :-(
Many thanks in advance!
Try MyGraphicsView.fitInView(MyScene.rect())
replacing MyGraphicsView and MyScene with the correct names for your code.
Valentin, you can use QGraphicsView::scale() function to zoom the graphics view. Another way to do that is to use QGraphicsView::setTransform() method passing QTransform object with a scale tranformation
精彩评论