Home > OS >  how to deselect row by clicking outside tableWidget pyqt5
how to deselect row by clicking outside tableWidget pyqt5

Time:07-04

I get the selected line with the

row = self.table.currentRow()

but when I click outside the tableWidget it keeps the last currentRow, how do I click anywhere outside the tableWidget the currentRow goes back to -1 and deselect the line

CodePudding user response:

according to the musicamante.

self.table.setCurrentIndex(QModelIndex())

it's exactly what I needed

  • Related