ClangTools: Make "go to next/previous diagnostic" open an editor

It's very likely that the user will want to have the respective location
displayed in the editor.

Fixes: QTCREATORBUG-20658
Change-Id: I34128c6444208571df566725e2ad1675d4456853
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2020-10-28 13:54:10 +01:00
parent 652feacd5f
commit b30b2f481c

View File

@@ -232,12 +232,14 @@ void DiagnosticView::goNext()
{ {
const QModelIndex currentIndex = selectionModel()->currentIndex(); const QModelIndex currentIndex = selectionModel()->currentIndex();
selectIndex(getIndex(currentIndex, Next)); selectIndex(getIndex(currentIndex, Next));
openEditorForCurrentIndex();
} }
void DiagnosticView::goBack() void DiagnosticView::goBack()
{ {
const QModelIndex currentIndex = selectionModel()->currentIndex(); const QModelIndex currentIndex = selectionModel()->currentIndex();
selectIndex(getIndex(currentIndex, Previous)); selectIndex(getIndex(currentIndex, Previous));
openEditorForCurrentIndex();
} }
QModelIndex DiagnosticView::getIndex(const QModelIndex &index, Direction direction) const QModelIndex DiagnosticView::getIndex(const QModelIndex &index, Direction direction) const