From d62c3663e9d6175ea3645987e7bf1a54901b8ad2 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 13 Feb 2010 12:34:36 +0100 Subject: [PATCH] qt: scroll to selection on results refresh. --- qt/base/results_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/base/results_model.py b/qt/base/results_model.py index fa2db241..751cb3ba 100644 --- a/qt/base/results_model.py +++ b/qt/base/results_model.py @@ -60,6 +60,7 @@ class ResultsModel(TreeModel): self.view.selectionModel().select(selection, flags) flags = QItemSelectionModel.Rows self.view.selectionModel().setCurrentIndex(selectedIndexes[0], flags) + self.view.scrollTo(selectedIndexes[0]) else: self.view.selectionModel().clear() @@ -144,8 +145,8 @@ class ResultsModel(TreeModel): #--- model --> view def refresh(self): self.reset() - self._updateSelection() self.view.expandAll() + self._updateSelection() def invalidate_markings(self): # redraw view