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

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.


One way (that I usually do as a workaround for not having to show the structure panel) is to select the layout, setting the top or bottom margins to any value (10, whatever) and then dragging the component into the layout. Yeah, that is just for the pure pleasure of dropping the component in the layout, i know, but is a way.


My small trick:

  • Select layout
  • Change temporary "layoutTopMargin"
  • Drop into layout required widgets
  • Restore layoutTopMargin to default 0