From 9493fab56bd187c8ae6df2792333480fc54e51ef Mon Sep 17 00:00:00 2001 From: hsoft Date: Tue, 16 Jun 2009 07:12:59 +0000 Subject: [PATCH] [#3] qt base: Moved the results' selection restoration code into the modelReset slot, so that everytime to model is reset, the selection is kept. --HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4060 --- base/qt/main_window.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/qt/main_window.py b/base/qt/main_window.py index 5b91a85e..f79b14e0 100644 --- a/base/qt/main_window.py +++ b/base/qt/main_window.py @@ -292,15 +292,15 @@ class MainWindow(QMainWindow, Ui_MainWindow): def resultsChanged(self): self.resultsView.model().reset() + + def resultsReset(self): + self.resultsView.expandAll() dupe = self.app.selected_dupe if dupe is not None: [modelIndex] = self.resultsModel.indexesForDupes([dupe]) if modelIndex.isValid(): flags = QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows - self.resultsView.selectionModel().select(modelIndex, flags) - - def resultsReset(self): - self.resultsView.expandAll() + self.resultsView.selectionModel().setCurrentIndex(modelIndex, flags) self._update_status_line() def selectionChanged(self, selected, deselected):