PDA

View Full Version : Font Size



MrShahi
9th July 2008, 05:58
Hello everyone
I have a little problem and I hope you will solve it......
My problem is that I wana create a dynamic widget and set its geometry according to the QString Size i.e If I write a string "Hello " and the font size of this string is 32,then I wana set height and width of the widget according to this string size..........
But I have no any idea how I do ??????:confused:

Please help me......................
Thanx;)

munna
9th July 2008, 06:07
QFontMetrics (http://doc.trolltech.com/3.3/qfontmetrics.html) is what you need to use to find out the height and width of your string.

MrShahi
9th July 2008, 06:27
Thanx ................................:)

wysota
9th July 2008, 07:37
Of course you are aware of the existance of QLabel, right? :)