PDA

View Full Version : sizeHint on QDialog is setting minimum size



lrb
22nd August 2014, 07:36
I'm trying to get a QDialog subclass to open at a default size but be resizable smaller.
When I implement sizeHint() to return e.g. QSize(400, 300), the dialog opens at the correct size but then can't be resized smaller, only larger.
If I remove the sizeHint method the dialog opens at the smallest possible size (50, 50) and can be resized no problem.
I tried also implementing minimumSizeHint to return (50, 50) but no effect.

Any ideas?

Thanks

anda_skoa
22nd August 2014, 11:26
What if you just call resize(400, 300) in the dialog's constructor?

Cheers,
_

Brandybuck
22nd August 2014, 17:36
If it is not resizing smaller than the size hint, that sounds to me like you have a Minimum size policy. Did you modify the size policy in your subclass (or in Designer)? You're not calling setMinimumSize() anywhere?