PYQT(16)QTableWidgets编辑事件


class myTableWidget(QTableWidget):
    def __init__(self,row,col):
        super().__init__(row,col)
        self.flag=0
        self.itemChanged.connect(self.update)
    def update(self):
        row_select = self.selectedItems()
        if len(row_select) == 0:
            return 0
        else:
            try:
                print(row_select[0].text())
                index=row_select[0].row()


                # for i in self.selectAll():
                #     print(i)
            except Example as e:
                print(e)

你可能感兴趣的:(PYQT(16)QTableWidgets编辑事件)