diff --git a/src/plugins/cppeditor/cppoutline.cpp b/src/plugins/cppeditor/cppoutline.cpp index f20fdb2dcaa9f42c07852920488595a7b99d298d..e0202231cd029780dcada9f878a78a4bf9196435 100644 --- a/src/plugins/cppeditor/cppoutline.cpp +++ b/src/plugins/cppeditor/cppoutline.cpp @@ -105,6 +105,7 @@ void CppOutlineWidget::updateSelectionInTree(const QModelIndex &index) qDebug() << "CppOutline - updating selection due to cursor move"; m_treeView->selectionModel()->select(proxyIndex, QItemSelectionModel::ClearAndSelect); + m_treeView->scrollTo(proxyIndex); m_blockCursorSync = false; } diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index d808a2e2d19fcbb570f9c3aab17f6910def2bf67..251121008633d3b4db909e1c38a94b6fb50705aa 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -337,6 +337,7 @@ void QmlJSOutlineWidget::updateSelectionInTree() m_blockCursorSync = true; m_treeView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect); + m_treeView->scrollTo(index); m_blockCursorSync = false; }