[Qt-interest] setSizePolicy has no effect in subclass of QDialog

Farid Derradji farid.derradji at ITWM.fraunhofer.de
Tue Jun 2 15:18:23 CEST 2009


Hello Stephen,

> I don't understand what you mean by the final sentence above.
> Could you expand on this ?

what I mean is the following:

every control inside a layout has to exactly tell how it wishes to be
arranged. And this is achieved via size policies.


> I've found a way to achieve what I want in designer: if you click
> on the form background, there is a context menu "Size constraints"
> from which you can set min/max height/width. If you reduce the design
> form to its maximum desired height, and set "Size Constraints"->
> "Set Maximum Height", then the dialog cannot be resized vertically.

I think that here you *statically* restricted the maximum size (or
minimum size respectively). Does your dialog really properly react now
if one of your sub controls changes in size (e.g. due to a font change)?

And, by the way, wouldn't it be better to use QLayout::minimumSize ()
instead ?

Regards
Farid



More information about the Qt-interest-old mailing list