[Interest] QLineEdit "stretch" in QHBoxLayout using designer

Alex Malyushytskyy alexmalvtk at gmail.com
Sat Feb 18 00:18:38 CET 2012


Carl,

Keep in mind for layout to work it has to be re-sized properly one way
or another.
Currently it is not. In your case you might want to create  layout for
the widget you place your controls on.
As for now layout you created has no any connection to the dialog boundaries.

I will try to explain what you did in one dimension

Point 1,4- left and right widget boundary 2,3 boundaries of your layout,

1               2 --------------- 3          4

1 and 2 are not connected anyhow, neither 3 and 4.
So your layout is not re- sized.

To achieve what I expect you want,
click your widget and click Layout vertically.

This will create your widget layout and add layout with 2 buttons in it.
If you are going to have only 2 widgets there you can destroy existing layout ,
since all you really need is "main widget" layout ( again, click
widget/dialog click Layout vertically )


Hope this helps.

Alex



On Fri, Feb 17, 2012 at 12:47 PM, Carl Schumann <schumann at fnal.gov> wrote:
> Qt community,
>
> I using Qt Designer to layout a very simple GUI via the following steps:
> 1. Using the "New Form" dialog I create a "Main Window"
> 2. Then a drop a Spin Box and a Line Edit widget onto the main window
> with the Line Edit to the right of the Spin Box.
> 3. Select both and then select Form -> Lay Out Horizontally from the
> main menu of Designer
> 4. Then try out the GUI with Form -> Preview ... from the main menu
>
> The Line Edit has a fixed width that does not respond to resizing the
> main window or entering long text.   How do I make the Line Edit stretch
> to use up all the empty space to its right in the main window please?
> Thanks for any help.
>
> Sincerely,
> Carl Schumann
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list