How to resize width to minimum possible using GUI

89 Views Asked by At

I use QtDesigner. I resized window width as small as possible using QtDesigner. But when window executed there is possible to make its width smaller. So I want to add to constructor code which made width as minimum possible using GUI.

1

There are 1 best solutions below

0
On BEST ANSWER

You can resize the window to minimumSizeHint() in the constructor:

resize(minimumSizeHint());

This will shrink the window to minimum size.

If you want to only shrink in width, then you can do something like:

resize(minimumSizeHint().width(), hight());