Hi.
I want to resize a dialog like the user can do with the mouse. An example:
The user cannot resize the dialog to 0 x 0 but if I call resize(0, 0) the dialog disappears.
I hope you now what I mean. :)
Printable View
Hi.
I want to resize a dialog like the user can do with the mouse. An example:
The user cannot resize the dialog to 0 x 0 but if I call resize(0, 0) the dialog disappears.
I hope you now what I mean. :)
I assume that you want to fit your width and height to the minimum and maximum size hint
Code:
if (your_width < minimumSizeHint().width()) { your_width = minimumSizeHint().width(); } else if (your_width > maximumSizeHint().width)) { your_width = maximumSizeHint().width(); } if (your_height < minimumSizeHint().height()) { your_height = minimumSizeHint().height(); } else if (your_height > maximumSizeHint().height()) { your_height = maximumSizeHint().height(); } resize(your_width, your_height);
That is just what I wanted. Thank you! :)
See also QLayout::closestAcceptableSize().