PDA

View Full Version : QLabel - auto font scaling possible?



Byngl
11th October 2007, 15:37
Is it possible to get a QLabel to automatically increase the size of the font so the text in the label occupies as much of the available space as possible (Ã la scaledContents for pixmaps)? I've attached some images to illustrate what I mean.

Start.png - the starting point
Desired.png - what I'd like to see
Actual.png - what I'm actually seeing

Perhaps I should be using something other than QLabel?

wysota
11th October 2007, 16:50
No, but if you want to display a simple text only, you can create your own QWidget subclass that will calculate the font size based on the widget size and draw the text accordingly.