Qt Forms Designer - Baffled
I try to do something every simple:
MainWindow Vertical Layout Horizontal Layout Line edit Button Text edit
I am completely lost how to achieve this with designer.
I have tried:
- Creating Vertical layout first, Horizontal second (inside vertical layout). The layouts are how I want them, but I cannot drag the line edit and button into the horizontal layout (neither in the forms view on the left nor in the tree on the right). I tried placing them into the vertical layout first and then "select ancestor", but that does not offer me the horizontal layout
- Creating horizontal layout with line edit and button first, then trying to put it into the vertical layout. View, tree, context menu, nothing seems to work
Easiest solution: Use a grid layout. Forget about nested layouts in designer.
This is the workaround I use:
- Select the layout that I want to put widgets in
- In the "properties" pane (bottom-right of Qt Creator), give the layout a 50-pixel margin
- Drag the widgets in
- Remove the margin added in #2