How to make one widget from several widgets in the designer

I have multiple fields and edit buttons in my dialog form in qt designer. I want to make one widget from my edit fields, 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 ui file form? I want to group my changes into one widget via the constructor.

+2


source to share


1 answer


You can do this using the advancement of the Qt designer ability. Create a new class (MyWidget1) and place text boxes and / or buttons as needed. Then in the main form, insert the widget and promote it to your class MyWidget1.



If you don't want to do this, you can always use groupgroups / frames for logical grouping.

+3


source







All Articles