QmlJsEditor: Fix crash on mode switch after save

Task-number: QDS-10709
Change-Id: I0eceef3815b6358d88329828d199d5918a273edf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Aleksei German
2023-09-19 17:37:06 +02:00
committed by Tim Jenssen
parent f2343b417e
commit 949612c23e

View File

@@ -145,10 +145,15 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
connect(m_editor, &QmlJSEditorWidget::outlineModelIndexChanged, connect(m_editor, &QmlJSEditorWidget::outlineModelIndexChanged,
this, &QmlJSOutlineWidget::updateSelectionInTree); this, &QmlJSOutlineWidget::updateSelectionInTree);
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QmlOutlineModel::updated, this, [this] () { connect(m_editor->qmlJsEditorDocument()->outlineModel(),
m_treeView->expandAll(); &QmlOutlineModel::updated,
m_editor->updateOutlineIndexNow(); this,
}); [treeView = QPointer(m_treeView), editor = QPointer(m_editor)]() {
if (treeView)
treeView->expandAll();
if (editor)
editor->updateOutlineIndexNow();
});
} }
QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const