from PyQt6 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        
        self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
        self.tabWidget.setGeometry(QtCore.QRect(20, 60, 431, 80))
        self.tabWidget.setObjectName("tabWidget")
        
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        
        self.comboBox = QtWidgets.QComboBox(parent=self.tab)
        self.comboBox.setGeometry(QtCore.QRect(10, 20, 391, 21))
        self.comboBox.setObjectName("comboBox")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        
        self.tabWidget.addTab(self.tab, "")
        
        self.tab2 = QtWidgets.QWidget()
        self.tab2.setObjectName("tab2")
        
        self.comboBox2 = QtWidgets.QComboBox(parent=self.tab2)
        self.comboBox2.setGeometry(QtCore.QRect(8, 20, 411, 22))
        self.comboBox2.setObjectName("comboBox2")
        self.comboBox2.addItem("")
        self.comboBox2.addItem("")
        
        self.tabWidget.addTab(self.tab2, "")
        
        self.tabWidget_2 = QtWidgets.QTabWidget(parent=self.centralwidget)
        self.tabWidget_2.setGeometry(QtCore.QRect(20, 170, 721, 341))
        self.tabWidget_2.setObjectName("tabWidget_2")
        
        self.tab3 = QtWidgets.QWidget()
        self.tab3.setObjectName("tab3")
        self.tabWidget_2.addTab(self.tab3, "")
        
        self.tab4 = QtWidgets.QWidget()
        self.tab4.setObjectName("tab4")
        self.tabWidget_2.addTab(self.tab4, "")
        
        self.tab5 = QtWidgets.QWidget()
        self.tab5.setObjectName("tab5")
        self.tabWidget_2.addTab(self.tab5, "")
        
        self.tabWidget3 = QtWidgets.QTabWidget(parent=self.centralwidget)
        self.tabWidget3.setGeometry(QtCore.QRect(470, 70, 281, 80))
        self.tabWidget3.setObjectName("tabWidget3")
        
        self.tab6 = QtWidgets.QWidget()
        self.tab6.setObjectName("tab6")
        
        self.pushButton = QtWidgets.QPushButton(parent=self.tab6)
        self.pushButton.setGeometry(QtCore.QRect(14, 20, 241, 23))
        self.pushButton.setObjectName("pushButton")
        
        self.tabWidget3.addTab(self.tab6, "")
        
        self.tab7 = QtWidgets.QWidget()
        self.tab7.setObjectName("tab7")
        
        self.pushButton2 = QtWidgets.QPushButton(parent=self.tab7)
        self.pushButton2.setGeometry(QtCore.QRect(20, 20, 221, 23))
        self.pushButton2.setObjectName("pushButton2")
        
        self.tabWidget3.addTab(self.tab7, "")
        
        MainWindow.setCentralWidget(self.centralwidget)
        
        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(1)
        self.tabWidget_2.setCurrentIndex(0)
        self.tabWidget3.setCurrentIndex(1)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        
        self.initialize_signals()

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.comboBox.setItemText(0, _translate("MainWindow", "1"))
        self.comboBox.setItemText(1, _translate("MainWindow", "2"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1"))
        self.comboBox2.setItemText(0, _translate("MainWindow", "3"))
        self.comboBox2.setItemText(1, _translate("MainWindow", "4"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab2), _translate("MainWindow", "Tab 2"))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab3), _translate("MainWindow", "Tab 1"))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab4), _translate("MainWindow", "Tab 2"))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab5), _translate("MainWindow", "Tab 3"))
        self.pushButton.setText(_translate("MainWindow", "PushButton"))
        self.tabWidget3.setTabText(self.tabWidget3.indexOf(self.tab6), _translate("MainWindow", "Tab 1"))
        self.pushButton2.setText(_translate("MainWindow", "PushButton2"))
        self.tabWidget3.setTabText(self.tabWidget3.indexOf(self.tab7), _translate("MainWindow", "Tab 2"))

    def initialize_signals(self):
        # Connect comboBox signals to methods
        self.comboBox.currentIndexChanged.connect(self.handle_combobox_change)
        self.comboBox2.currentIndexChanged.connect(self.handle_combobox2_change)
        
        # Connect pushButton signals to methods
        self.pushButton.clicked.connect(self.handle_push_button)
        self.pushButton2.clicked.connect(self.handle_push_button2)

    def handle_combobox_change(self, index):
        if index == 0:  # Index for "1"
            self.tabWidget_2.setCurrentIndex(0)  # Set to tab3
        elif index == 1:  # Index for "2"
            self.tabWidget_2.setCurrentIndex(1)  # Set to tab4

    def handle_combobox2_change(self, index):
         if index == 0:  # Index for "3"
            self.tabWidget_2.setCurrentIndex(2)  # Set to tab5

    def handle_push_button(self):
        # Set tabWidget to tab2
        self.tabWidget.setCurrentIndex(1)

    def handle_push_button2(self):
        # Set tabWidget to tab (initial tab)
        self.tabWidget.setCurrentIndex(0)

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec())

Добавить функцию чтобы переключались в tabWidget3 c tab6 на tab7 при нажатии на кнопку