I already tried several methods on displaying an image on a form, but none of them works how I would like.
I\'ve read many places that the easiest way is to create a la
Actually there is a very simple solution for this problem. There are two things you should modify:
Set the label's size policy to ignored
QLabel lblImage;
lblImage->setPixmap( QPixmap( "big_image.jpg" ) );
lblImage->setScaledContents( true );
lblImage->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored );
If the lblImage
is resizing automatically, the image will stretch to the size of the label.