Commit 7c365061 authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlOutline: Ensure that element is always selected

Select parent element if the property isn't shown in outline (due to
parent b0bc76ec
......@@ -145,8 +145,16 @@ void QmlJSOutlineWidget::updateSelectionInTree(const QModelIndex &index)
m_blockCursorSync = true;
m_treeView->selectionModel()->select(m_filterModel->mapFromSource(index), QItemSelectionModel::ClearAndSelect);
QModelIndex baseIndex = index;
QModelIndex filterIndex = m_filterModel->mapFromSource(baseIndex);
while (baseIndex.isValid() && !filterIndex.isValid()) { // Search for ancestor index actually shown
baseIndex = baseIndex.parent();
filterIndex = m_filterModel->mapFromSource(baseIndex);
m_treeView->selectionModel()->select(filterIndex, QItemSelectionModel::ClearAndSelect);
m_blockCursorSync = false;
Supports Markdown
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