def updaterow(self):
if self.ui.tableWidget.currentIndex().row() > -1:
record = self.model.record(self.ui.tableWidget.currentIndex().row())
record.setValue("Name",self.ui.lineEdit.text())
record.setValue("Surname",self.ui.lineEdit_2.text())
record.setValue("DOB", self.ui.dateEdit.text())
record.setValue("Phone", self.ui.lineEdit_3.text())
self.model.setRecord(self.ui.tableWidget.currentIndex().row(), record)
else:
QMessageBox.question(self,'Message', "Please select a row would you like to update", QMessageBox.Ok)
self.show()
评论列表
文章目录