Commit 0f8a491e authored by Kai Koehne's avatar Kai Koehne
Browse files

Make sure current index is always visible in Outline QTreeViews

parent 8acde74d
...@@ -105,6 +105,7 @@ void CppOutlineWidget::updateSelectionInTree(const QModelIndex &index) ...@@ -105,6 +105,7 @@ void CppOutlineWidget::updateSelectionInTree(const QModelIndex &index)
qDebug() << "CppOutline - updating selection due to cursor move"; qDebug() << "CppOutline - updating selection due to cursor move";
m_treeView->selectionModel()->select(proxyIndex, QItemSelectionModel::ClearAndSelect); m_treeView->selectionModel()->select(proxyIndex, QItemSelectionModel::ClearAndSelect);
m_treeView->scrollTo(proxyIndex);
m_blockCursorSync = false; m_blockCursorSync = false;
} }
......
...@@ -337,6 +337,7 @@ void QmlJSOutlineWidget::updateSelectionInTree() ...@@ -337,6 +337,7 @@ void QmlJSOutlineWidget::updateSelectionInTree()
m_blockCursorSync = true; m_blockCursorSync = true;
m_treeView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect); m_treeView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
m_treeView->scrollTo(index);
m_blockCursorSync = false; m_blockCursorSync = false;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment