PDA

View Full Version : QLabel to scale a graphic



Scorp2us
17th March 2009, 04:54
I am trying to use a QLabel to display a pixmap. I want to be able to have it stretch and shrink as the window is resized. With text, it works normally.

But when I set a pixmap and scaledContents = true, then it doesn't respect the aspect ratio.
What's worse is when I scale the pixmap to maintain the aspect ratio, you can't shrink it.

Anyone know how I can do this using a standard QLabel?

Thanks!

Scorp2us
17th March 2009, 05:55
Doh. I got it.

You need to set minimumSize, else minimumSize=currentSize and it never gets smaller!