[Qt-interest] QGraphicsTextItem adjustSize()
Stacy Alley
salley at usgs.gov
Mon Feb 23 22:23:42 CET 2009
Thanks Sean. Good idea. I need to start simple.
I did try outputting the scale factors and it turns out the scale factor
is one. So
there is now wonder I'm not seeing an improvement. So I'll take your
suggestion
and write a simple example to figure out where I'm going wrong.
Thanks again!
Stacy
Sean Harmer wrote:
> Hi,
>
> On Monday 23 February 2009 18:47:06 Stacy Alley wrote:
>
>> 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?
>>
> That should be:
>
> p_label->scale (1.0/m11(), 1.0/m.m22() );
>
> Don't forget the scaling in the y-direction!
>
>
>> when do you set your font size and to
>> what number?
>>
> I just set it to 12 pint in the c'tor of my Plot class which has the
> QGraphicsSimpleTextItem as a member.
>
> I would try boiling it down to a simple example first with just an item that
> sets the scene coord system and a text item. Also useful is to output the
> scale factors to make sure they look sensible.
>
> Sean
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list