user152508
user152508

Reputation: 3131

How to make one widget from multiple widgets in designer

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 .

Upvotes: 2

Views: 1385

Answers (1)

zweihander
zweihander

Reputation: 6295

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.

Upvotes: 3

Related Questions