tags:

views:

90

answers:

1

Hello

I have multiple edit boxes and buttons on my dialog form in qt designer. I want to make one widget from my edit boxes, something like this :

<widget class="QWidget" native="1" name="widget_2" >

<item>
<widget class="QLineEdit" name="lineEdit_2" >
</item>
<item>
<widget class="QLineEdit" name="lineEdit_3" >
</item> 
</widget>

Can I do this but without manually editing the form ui file ? that is I want to group my line edits in one widget through designer .

+2  A: 

You could do it using promotion ability of Qt designer. Make a new class (MyWidget1) and put textboxes and/or buttons as you need. Then, on your main form, insert a widget and promote it to your MyWidget1 class.

If you don't want to go through with this, you can always use groupboxes/frames for logical grouping.

erelender
erelender is right. promotion is probably the easiest way. I personally use a lot of layouts (vertical, horiz, grid, etc), sometimes QFrames...
Karol Wilk