Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt designer: How to add widget to a layout in the designer when the layout appears infinitely thin?

I am using Qt Designer, and I would like to move a couple of top-level widgets into a horizontal layout.

I have dragged a "Horizontal Layout" object into the form. I am now attempting to drag the desired widgets into the layout.

Unfortunately, the new Horizontal Layout widget is infinitely thin:

Infinitely Thin Layout

... and I cannot drag my "Import Progress" label widget or my progress bar widget into the new horizontal layout widget.

Note that when I attempt to drag the desired widgets over the new horizontal layout widget, Qt Designer does not do anything useful for me in terms of expanding the drop region to make the horizontal widget available as a drop target. So I'm stuck.

How do I add widgets to an infinitely-thin layout widget in Qt Designer?

like image 977
Dan Nissenbaum Avatar asked Mar 23 '14 21:03

Dan Nissenbaum


People also ask

How do I resize a layout in Qt?

Setting A Top Level Layout To check if you have set a top level layout, preview your widget and attempt to resize the window by dragging the size grip. To apply a layout, you can select your choice of layout from the toolbar shown on the left, or from the context menu shown below.


1 Answers

Select the layout, and then drop the widget onto the corresponding selected item in the Object Inspector pane. If you find it tricky to select the layout on the actual form, you can also select it via the Object Inspector pane.

like image 94
ekhumoro Avatar answered Sep 29 '22 02:09

ekhumoro