fix multiple selection on ctrl+f

This commit is contained in:
Damien Elmes 2008-12-21 14:31:33 +09:00
parent 44b5b1670a
commit d4004577f9

View file

@ -380,7 +380,10 @@ class EditDeck(QMainWindow):
currentCardIndex = self.findCardInDeckModel( currentCardIndex = self.findCardInDeckModel(
self.model, self.parent.currentCard) self.model, self.parent.currentCard)
if currentCardIndex >= 0: 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.dialog.tableView.scrollTo(
self.model.index(currentCardIndex,0), self.model.index(currentCardIndex,0),
self.dialog.tableView.PositionAtTop) self.dialog.tableView.PositionAtTop)