Valgrind: Re-focus error view after cursor navigation

Change-Id: I4519a36107b7b2a8895d154fbcc7052aecb5d9c6
Task-number: QTCREATORBUG-15866
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-04-13 16:55:49 +02:00
parent 6b77dea65a
commit 1037482506
2 changed files with 7 additions and 1 deletions

View File

@@ -167,6 +167,12 @@ void DetailedErrorView::contextMenuEvent(QContextMenuEvent *e)
menu.exec(e->globalPos()); menu.exec(e->globalPos());
} }
void DetailedErrorView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
QTreeView::currentChanged(current, previous);
scrollTo(current);
}
void DetailedErrorView::goNext() void DetailedErrorView::goNext()
{ {
QTC_ASSERT(rowCount(), return); QTC_ASSERT(rowCount(), return);
@@ -208,7 +214,6 @@ void DetailedErrorView::setCurrentRow(int row)
const QModelIndex index = model()->index(row, 0); const QModelIndex index = model()->index(row, 0);
selectionModel()->setCurrentIndex(index, selectionModel()->setCurrentIndex(index,
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
scrollTo(index);
} }
} // namespace Debugger } // namespace Debugger

View File

@@ -56,6 +56,7 @@ public:
private: private:
void contextMenuEvent(QContextMenuEvent *e) override; void contextMenuEvent(QContextMenuEvent *e) override;
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
int currentRow() const; int currentRow() const;
void setCurrentRow(int row); void setCurrentRow(int row);