[Qt-interest] How to fix the size of a LineEditor in a Layout

John McClurkin jwm at nei.nih.gov
Tue Jun 23 19:19:54 CEST 2009


Pierre-Luc Loyer wrote:
> Hi,
> 
> I am new to Qt, but i'll try anyway.
> Have you tried to set : QWidget -> maximumSize -> Width = 40.
> 
> On Tue, Jun 23, 2009 at 2:16 AM, Joe Liu <passer.by007gg at gmail.com 
> <mailto:passer.by007gg at gmail.com>> wrote:
> 
>     Hi,
> 
>     I use Qt designer to generate the layout of all widgets in my dialog.
> 
>     I now have two widgets, a LineEditor and a Slider. I grouped them in
>     an HBoxLayout, however, every time I attempt to do so, the
>     lineeditor is automatically resized to 133 pixel width, while I
>     actually want one in 40 pixel width.
> 
>     I tried to assign the lineeditor different size policies, but they
>     seems do not work at all. I can not change the lineeditor's size in
>     whatever way.
> 
>     Do you have any idea on how to force a lineeditor to a customized
>     size by using the Qt Designer?
> 
>     Thank you.
> 
>     Joe
> 
Try using a horizontal spacer in your layout.



More information about the Qt-interest-old mailing list