[Qt-interest] dock widget expansion

Frederic Tingaud tingaud at gostai.com
Wed Feb 17 15:59:23 CET 2010


Frederic Tingaud a écrit :
> Hi,
> I already spent some time on this problem, but I cannot figure out where
> it comes from:
> In my main window, I have a complex widget in a dock widget. I am pretty
> sure every element composing this widget have a size policy set to
> "preferred" and small minimumSizes.
> My central widget has the same minimumSize than the dock widget
> minimumSizeHint, a bigger sizeHint and I tried setting the sizePolicy to
> Expanding or Preferred, and setting stretch factors, but no matter what,
> the central widget appears at its minimum size while the dock widget is
> expanded. I do not want to input hard-coded sizes and I don't want to
> use a MinimumExpanding sizePolicy, because I want the user to be able to
> resize everything freely, but I assume there is a clean way to resolve
> this problem.
> As any one encountered and resolved such a problem ?
>
> Frederic Tingaud
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   
I made a work-around, by overloading the sizeHint method of my docked
widget to return minimumSizeHint, but if anybody knows why dock widget
are expanded to their sizeHint before starting expanding the
centralWidget, I am interested in the answer.

Regards,

Frederic Tingaud



More information about the Qt-interest-old mailing list