[SOLVED] How to overlap images with resizing in a broken layout qframe
-
Hi and welcome
The QLabel will be fit to the image size and not the other way around. (sadly)
If you want to keep the image with in a some box, you must re-size it your self.QPixmap p( QString(":/dog.png") ); int w = label->width(); int h = label->height(); // set a scaled pixmap to a w x h box keeping its aspect ratio label->setPixmap(p.scaled(w,h,Qt::KeepAspectRatio));
Note that you should the the MaximumHeight of the QLabel (with the dog) to the max size you think it should have before
setting the image. (label->setMaximumHeigh( xxx) ) -
Hi @mrjj,
Thank you fer helping me. Your solution works, even though as the dog's Image needs to be bigger as there will be some details that needs to be showed clearly.
I tried to increase the available space (reducing the spacing between the horizontal spacers) but the result is still being the same (like if the change does not were done).
Any Idea?
Thank you for your help and time.
Best regards.
-
Hi
Well im not 100% sure how you setup the inner box.
if you want frameAnimalConatiner to be bigger, you could set its MinimumWidth or height and
spacers will follow that.Are you planning on animation later on ?
-
@sohyun
breaks in what way?
Can you upload the picture to postimage.org and post link here ? -
Hmm. that is odd.
Do you load the same image file on both platforms?
What is the format ? (jpg,png) etc.Can you upload the original image so i can try in my linux box?
Maybe a support SO has issues on your box or something like that.