Greetings.
I wanted to know if you can change the size of a QLabel inside the program.
The problem is as follows:
I have a dialog box that shows, among many other widgets, a QLabel in which displays an image. I want the image then appears with the same ratio height / width actually have. For this, I set the minimum size of QLabel so that the ratio is respected. However, this does not guarantee that the image is shown with the minimum size of QLabel or maintaining the desired proportion, I keep getting images to appear larger sizes to minimum size without respecting the desired ratio, for example, images where height is greater than the width, are wider than high. Obviously, I understand that establish the minimum size of the label (which was what I did) does not generates the result I seek … achieved only thing was that when the dialog is resized manually by the user to its minimum size, the picture looks as it should, but in other cases not… Do not know what else to do.
As I said I just want the label showing the retio height/width of the actual image, I do not mind not display a size slightly greater than the minimum size.
Another issue is that I would like to make the dialog appear with a height and width that were a percentage of the height and width of the parent widget respectively. However, the current size of the dialog box is determined by the size of QLabel, or rather, by the size at which the QLabel shows the image.
Thanks for any help and/or suggestions.
↧