How can I select by rows instead of individual cells in QTableView in PyQt?
For C++ the answer is
tableView->setSelectionBehavior(QTableView::SelectRows);
In PyQt5 SelectRows
has moved. The code is now:
self.tv.setSelectionBehavior(QtWidgets.QTableView.SelectRows)
That turned out to be easier than I thought. Simply adding this row makes the selection to be by row instead of cell.
self.tv.setSelectionBehavior(QAbstractItemView.SelectRows)