forked from qt-creator/qt-creator
Qmljs: fix a crash when m_treeview is deleted
Change-Id: I3743815c14151b49784a20cdb0c0bba2fbde4e7b Reviewed-by: Marco Benelli <marco.benelli@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user