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.


  • Moderators

    This is the workaround I use:

    1. Select the layout that I want to put widgets in
    2. In the "properties" pane (bottom-right of Qt Creator), give the layout a 50-pixel margin
    3. Drag the widgets in
    4. Remove the margin added in #2

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.