[Kde-games-devel] QGraphicsView and fitInView

Pierre Maurier pierre.maurier at gadz.org
Wed Feb 25 00:56:19 CET 2009


Le vendredi 20 février 2009 19:34:09 Pierre Maurier, vous avez écrit :
> Hi,
>
> I'm learning little by little to use the Qt Graphics View Framework.
>
More with my problems :

What I want to do : have my QGraphicsView display one part of my Scene (where 
the game is displayed) a rectangular area (top left : 0,0 ; width : x ; height 
: y)

What I tried :
fitInView(0,0,x,y,Qt.KeepAspectRatio) : good size but the rectangle area isn't 
well centered (ie. if I move the scrollbars, I manage to get what I want).

ensureVisible(0,0,x,y) : seems to do nothing (the view is still centered on 
the item and is too big)

What can I use to get what I want ?

(Sorry to annoy you with my questions...)

Regards.
-- 
Pierre Maurier



More information about the kde-games-devel mailing list