Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, February 2007
fit items to graphicsView


Message 1 in thread

Hi,

How can i in QGraphicsview scale all items to fit the scene?
i tried view->fitinView(item->boundingRect());
which only zooms into parts of the scene.

--
 [ signature omitted ] 

Message 2 in thread

On Tuesday 13 February 2007 15:54, suleiman wrote:
> Hi,
>
> How can i in QGraphicsview scale all items to fit the scene?
> i tried view->fitinView(item->boundingRect());
> which only zooms into parts of the scene.

You could try: 

	view->fitInView ( scene->boundingRect());

or perhaps:

	view->fitInView ( scene->itemsBoundingRect());

where "scene" is your QGraphicsScene. Note that "item" refers to a single 
item...

-- 
 [ signature omitted ]