Layout and spacing

Andrzej JR Hunt andrzej at ahunt.org
Sat Mar 6 18:42:09 CET 2010


Yes, there is a simpler solution: assuming you are using a layout supporting 
insertion of stretches you can use:
layout.addStretch(1);
after adding the buttons and before adding the LineEdit onto the layout, which 
pushes the linedit to the other side of the layout, by inserting a spacer 
that resizes to be as wide as possible.

On Saturday 06 March 2010 18:31:04 Cédric Bellegarde wrote:
> Hello,
>
> on the attached screenshot, you will see an horizontal layout with buttons
> and a LineEdit.
>
> What i want is buttons on the left and LineEdit on the right.
>
> The only solution i see is calculate layout size, and items size and do:
> layout.setItemSpacing (LastButtonIndex, (layoutWidth - ItemsWidth))
>
> Am i right, is there a simpler solution?
>
> Thanks.
>
> Cédric



-- 
Andrzej JR Hunt -- andrzej (at) ahunt.org


More information about the Plasma-devel mailing list