diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index 9cd3e78eae6..435725c0b27 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -125,12 +125,12 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor) m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel()); m_treeView->expandAll(); - connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, [this]() { - if (m_treeView && m_treeView->selectionModel()) + connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, m_treeView, [this]() { + if (m_treeView->selectionModel()) m_treeView->selectionModel()->blockSignals(true); }); - connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, [this]() { - if (m_treeView && m_treeView->selectionModel()) + connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, m_treeView, [this]() { + if (m_treeView->selectionModel()) m_treeView->selectionModel()->blockSignals(false); });