From d4004577f9af6b386e7b36ab592a28534207c00c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 21 Dec 2008 14:31:33 +0900 Subject: [PATCH] fix multiple selection on ctrl+f --- ankiqt/ui/cardlist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)