osiris81

20th January 2010, 14:19

Hi,

I need to find out the maximum text width of an interval, lets say [-100.50, 100.50] with precision of two.

I can find out the text width using the QFontMetrics, but that works only for a sample string. I'd have to convert every number in the interval to a string and calculate the width for it to get the maximum. Is there an easier way?

Thanks!

I need to find out the maximum text width of an interval, lets say [-100.50, 100.50] with precision of two.

I can find out the text width using the QFontMetrics, but that works only for a sample string. I'd have to convert every number in the interval to a string and calculate the width for it to get the maximum. Is there an easier way?

Thanks!