[Qt-interest] QGraphicsTextItem adjustSize()

Stacy Alley salley at usgs.gov
Mon Feb 23 19:47:06 CET 2009


Thank you Sean.
I feel like I understand the scaling part now, but I'm still not seeing 
my text appear.
If I hard code the font size to some large number I can see the text, 
but when I set the font
size to a reasonable number (12) and then try to do the p_label->scale 
(1.0/m11(), m.m22() ); line I loose my
text. Am I missing something?  when do you set your font size and to 
what number?
Thanks for your help!!
Stacy

Sean Harmer wrote:
> 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
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   

-- 
Stacy Alley

Astrogeology Team Programmer
U.S. Geological Survey
2255 North Gemini Drive
Flagstaff, AZ 86001
(928)556-7258




More information about the Qt-interest-old mailing list