A QTabWidget contains a number of QWidgets, which themselves contain all the controls for that tab.
So when you create a new ui in designer, you create your own QWidget-derived widget, add your contrtols there, and then on your main form you have placeholders (QWidgets) which you promote to the class you created above. The end result is that on your main page, you don't see the control in the tabs, but you do when you run your app.
So one ui file will be your main app, and the other ui file will contain the controls for a tab page, which you can duplicate as much as you like.
Eg.
<widget class="QTabWidget" name="tabWidget">
<widget class="myTab" name="tab">
</widget>
<widget class="myTab" name="tab_2">
</widget>
</widget>
[...]
<customwidgets>
<customwidget>
<class>myTab</class>
<extends>QWidget</extends>
<header location="global">mytab.h</header>
</customwidget>
</customwidgets>
<widget class="QTabWidget" name="tabWidget">
<widget class="myTab" name="tab">
</widget>
<widget class="myTab" name="tab_2">
</widget>
</widget>
[...]
<customwidgets>
<customwidget>
<class>myTab</class>
<extends>QWidget</extends>
<header location="global">mytab.h</header>
</customwidget>
</customwidgets>
To copy to clipboard, switch view to plain text mode
where mytab.h would be the header file created by Designer for your actual tab (derived from QWidget).
Bookmarks