def deleteRow(self): print('Delete Row Clicked') indices = [] for index in self.table.selectionModel().selectedRows(): indices.append(QtCore.QPersistentModelIndex(index)) for index in indices: self.table.removeRow(index.row())
def addRow(self): print('Add Row Clicked') indices = [] for index in self.table.selectionModel().selectedRows(): indices.append(QtCore.QPersistentModelIndex(index)) if len(indices) > 0: for index in indices: self.insertRow(index.row()) else: self.insertRow(self.table.rowCount())