Compute height of wrapped text [Solved]

psquare

13-05-2010 08:56:19

I need to set the height of a widget to be equal to number of lines that result. This should take into the wrapping as well. The width of the widget remains constant. I experimented with Edit Widget/StaticText, but could not find a way to do this.

Any ideas?

Altren

13-05-2010 17:09:28

Try to assign text with WordWrap enabled, then use edit->getTextSize().height .

psquare

14-05-2010 10:29:22

Thanks Altren. That works perfectly!