开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜