diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index 1f4231a75..962dff28c 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -380,7 +380,10 @@ class EditDeck(QMainWindow): currentCardIndex = self.findCardInDeckModel( self.model, self.parent.currentCard) if currentCardIndex >= 0: - self.dialog.tableView.selectRow(currentCardIndex) + sm = self.dialog.tableView.selectionModel() + sm.clear() + sm.select(self.model.index(currentCardIndex, 0), + QItemSelectionModel.Select | QItemSelectionModel.Rows) self.dialog.tableView.scrollTo( self.model.index(currentCardIndex,0), self.dialog.tableView.PositionAtTop)