from PyQt5 import QtWidgets from gui.widgets import mainForm class MainWindow(QtWidgets.QWidget, mainForm.Ui_Form): def __init__(self): super().__init__() self.setupUi(self) def show_plot_tabs(self, plot_widgets: list[QtWidgets.QWidget]) -> None: for plot_widget in plot_widgets: tab = QtWidgets.QWidget() grid = QtWidgets.QGridLayout() grid.addWidget(plot_widget) tab.setLayout(grid) self.tabWidget.addTab(tab, "text") self.tabWidget.setCurrentWidget(tab)