From cbd96ef3125a1417e68c92c20b015a3c285ac33c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 16 Nov 2022 14:16:22 +0100 Subject: [PATCH] QmlDesigner: Fix crash The timer can timeout after a detach. Change-Id: I7eafe0a3d666942841cc0ee64d850acfab418c7c Reviewed-by: Reviewed-by: Tim Jenssen --- .../components/propertyeditor/propertyeditorview.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index aa876885883..5788f3b3a52 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -593,10 +593,12 @@ void PropertyEditorView::modelAttached(Model *model) m_locked = true; if (!m_setupCompleted) { - QTimer::singleShot(50, this, [this]{ - PropertyEditorView::setupPanes(); - /* workaround for QTBUG-75847 */ - reloadQml(); + QTimer::singleShot(50, this, [this] { + if (isAttached()) { + PropertyEditorView::setupPanes(); + /* workaround for QTBUG-75847 */ + reloadQml(); + } }); }