def add_row(self,pos,name,top_btm,active,start,width,depth,voltage):
pos= tab_insert_row(self.tab)
self.tab.blockSignals(True)
self.tab.setItem(pos,0,QTableWidgetItem(name))
combobox = QComboBoxLang()
combobox.addItemLang("top",_("top"))
combobox.addItemLang("bottom",_("bottom"))
self.tab.setCellWidget(pos,1, combobox)
combobox.setValue_using_english(top_btm.lower())
#combobox.setCurrentIndex(combobox.findText(top_btm.lower()))
combobox.currentIndexChanged.connect(self.save)
combobox = QComboBoxLang()
combobox.addItemLang("true",_("true"))
combobox.addItemLang("false",_("false"))
self.tab.setCellWidget(pos,2, combobox)
combobox.setValue_using_english(active.lower()) #setCurrentIndex(combobox.findText(active.lower()))
combobox.currentIndexChanged.connect(self.save)
self.tab.setItem(pos,3,QTableWidgetItem(start))
self.tab.setItem(pos,4,QTableWidgetItem(width))
self.tab.setItem(pos,5,QTableWidgetItem(depth))
self.tab.setItem(pos,6,QTableWidgetItem(voltage))
self.tab.blockSignals(False)
评论列表
文章目录