Commit 429163ea authored by Tim Jenssen's avatar Tim Jenssen

Qmljs: fix a crash when m_treeview is deleted

Change-Id: I3743815c14151b49784a20cdb0c0bba2fbde4e7b
Reviewed-by: default avatarMarco Benelli <marco.benelli@qt.io>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 3b956976
......@@ -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);
});
......
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