[Qt-interest] QGraphicsTextItem adjustSize()

Sean Harmer sean.harmer at maps-technology.com
Mon Feb 23 19:40:27 CET 2009


On Monday 23 February 2009 17:56:36 Stacy Alley wrote:
> Hi Sean,
> This look promising!  I'm wondering what type of object you are
> implementing the resizeEvent method in
> so that you have a rect() method (when you calculate dx and dy)?  I'm
> inside a QGraphicsPolygonItem and I have access to boundingRect but not
> rect.
Oh yes sorry I forgot to mention this is a QGraphicsWidgetItem subclass. 
However you could just use boundingRect() from QGraphicsItem. This is only to 
centre the text wrt the containing object though. The bit you were after was 
the scaling part.

Good luck,

Sean



More information about the Qt-interest-old mailing list