[Panel-devel] boxlayout patch

Robert Knight robertknight at gmail.com
Fri Oct 12 14:54:41 CEST 2007


> Example: Three widgets. If sizeHint returns 20, 30, 50 It tires to give 20%,
> 30%, 50% from space available. Now it gives 33% for each.

That is not how sizeHint() is intended to be used (in Qt's layout
system).  In Qt I think you would do this by assigning stretch factors
to the various items in the layout to adjust the ratio by which space
is divided between items.

If you want a generic solution for the Plasma libs then implementing
stretch factor support would be a better solution.  Otherwise keep
your modified BoxLayout private as part of your System Monitor applet.

Regards,
Robert.

On 11/10/2007, Petri Damstén <petri.damsten at dnainternet.net> wrote:
> On Thursday 11 October 2007 16:37:50 Robert Knight wrote:
> > > I need widgets scaled so that space is calculated from sizeHint
> >
> > Do you mean that you require support for aspect ratios?
>
> Example: Three widgets. If sizeHint returns 20, 30, 50 It tires to give 20%,
> 30%, 50% from space available. Now it gives 33% for each.
>
> Petri
>
> PS. This post got sent twice and now have two threads.
>
> --
> "Programmers are tools for converting caffeine into code."
>
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel
>
>
>


More information about the Panel-devel mailing list