Feb-29-2020, 11:00 AM
hello;
I apologize for this delay, but I changed orientation: instead of creating another class, I proceeded to create a function with arguments to replace the other functions each associated with its own widget,I proceeded like this (this is a minimal code) :
I apologize for this delay, but I changed orientation: instead of creating another class, I proceeded to create a function with arguments to replace the other functions each associated with its own widget,I proceeded like this (this is a minimal code) :
class MainApp(QMainWindow,Ui_MainWindow) : def __init__(self,parent=None) : super(MainApp,self).__init__(parent) QMainWindow.__init__(self) self.setupUi(self) self.win_UI() ################################ parametre=QTableWidget() ##################################### def win_UI(self): #root = QFileInfo(__file__).absolutePath() #for absolute path of the icons self.setWindowTitle("ddm") self.setGeometry(10,40,1140,653) self.radioButton_correction.toggled.connect(self.initialize_all_tableWidget) #initialize tableWidget : def initialize_correction_tableWidget(self,parametre): parametre.clear() parametre.setHorizontalHeaderItem(0, QTableWidgetItem("date")) parametre.setHorizontalHeaderItem(1, QTableWidgetItem("hour")) parametre.setHorizontalHeaderItem(2, QTableWidgetItem("Monitor1")) parametre.setHorizontalHeaderItem(3, QTableWidgetItem("Monitor2")) #initialize all tableWidget : def initialize_all_tableWidget(self): for correction in (self.tableWidget_correction_loc35R,self.tableWidget_correction_loc35L,self.tableWidget_correction_gp35R,self.tableWidget_correction_gp35L,self.tableWidget_rechercher_operation_cev_loc35R,self.tableWidget_rechercher_operation_cev_gp35R,self.tableWidget_rechercher_operation_cev_loc35L,self.tableWidget_rechercher_operation_cev_gp35L) : self.initialize_correction_tableWidget(correction) def main(): app=QApplication(sys.argv) win=MainApp() win.show() app.exec_()# infinite loop if __name__=='__main__' : main()