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

Stephen Collyer scollyer at netspinner.co.uk
Tue Jun 2 10:19:07 CEST 2009


2009/6/2 Tony Rietwyk <tony.rietwyk at rightsoft.com.au>
>
>
> Do you have a layout within the dialog?  In that case, sizePolicy doesn't
> apply.  To get the dialog to size according to its contents, have a look at
> QLayout::setSizeConstraint( QLayout::SetFixedSize ).  Though, I suspect this
> will affect both directions, not just vertically.
>

Yes, I have a grid layout inside the dialog, which I created via designer.
Why does this mean that sizePolicy doesn't apply ?


> Also, I'm not sure when the sizeHint is actually meaningful.
>

I have to admit I'm not at all sure when setSizeHint() has any useful
effect. Sometimes it seems to be ignored, sometimes not - maybe it's
related to the presence or absence of an internal layout in the dialog too ?

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090602/6614dc19/attachment.html 


More information about the Qt-interest-old mailing list