diff --git a/src/plugins/debugger/analyzer/detailederrorview.cpp b/src/plugins/debugger/analyzer/detailederrorview.cpp index 7a47e408576..38ea2f7a245 100644 --- a/src/plugins/debugger/analyzer/detailederrorview.cpp +++ b/src/plugins/debugger/analyzer/detailederrorview.cpp @@ -167,6 +167,12 @@ void DetailedErrorView::contextMenuEvent(QContextMenuEvent *e) menu.exec(e->globalPos()); } +void DetailedErrorView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) +{ + QTreeView::currentChanged(current, previous); + scrollTo(current); +} + void DetailedErrorView::goNext() { QTC_ASSERT(rowCount(), return); @@ -208,7 +214,6 @@ void DetailedErrorView::setCurrentRow(int row) const QModelIndex index = model()->index(row, 0); selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); - scrollTo(index); } } // namespace Debugger diff --git a/src/plugins/debugger/analyzer/detailederrorview.h b/src/plugins/debugger/analyzer/detailederrorview.h index ab141ad57ec..3e10e1e3d99 100644 --- a/src/plugins/debugger/analyzer/detailederrorview.h +++ b/src/plugins/debugger/analyzer/detailederrorview.h @@ -56,6 +56,7 @@ public: private: void contextMenuEvent(QContextMenuEvent *e) override; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; int currentRow() const; void setCurrentRow(int row);