Relation between size policies, setting fixed size, and setting minimum size of widgets
-
I'm wondering about the behavior and the relationship between Qwidget's setSizePolicy and setFixedSize methods (and of course the other setting width and height methods).
(all the following numbers are pixels)
for example, I tried in the designer setting the size policy of a widget (Qlabel) to be expanding and at the same time set its fixed size using the setFixedSize method (to some size) - When I run the widget I've seen that I can shrink it as much as I want and on the other way I can stretch it as much as I want, So what is the impact or the meaning of using setFixedSize together with expanding policy?For another example, I set the Minimum width of the Qlabel to 800 and fixed horizontal size policy, and set the minimum size of the form holding this Qlabel to 200 with expanding horizontal size policy, when I played with the form I have been able to shrink it far more than 800 (Qlabel almost disappeared) but couldn't shrink it more than 200, So what is the significance of setting the minimum size of Qlabel in this case?
The last example, I had another Qlabel with a fixed height set to 40 and it was placed on a form with some other widgets, when I set it's vertical policy to Minimum expanding it enlarged the height of the form, with lots of empty space between it and the other elements preceding it (above it), with no reason - like I said, just lot of empty space. But when I changed the size policy to Fixed it got to be ok, it was placed Immediately (with some margin) after the preceding widgets of that form, below them. So the question is, why does setting its size policy to minimum expanding cause this waste of space when the fixed size is defined as only 40? why does the form grows so much and not just by the size of the widgets + it's margins?
Thank you in advance!