QmlDesigner: Fix crash

We have to check if the view is actually detached.

Change-Id: I160c1a15f921092ef66999ed6a27ffcdbbe205d9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2020-10-05 19:26:13 +02:00
parent b2b35eeddc
commit b9cc9c9bfa
2 changed files with 8 additions and 4 deletions

View File

@@ -131,8 +131,10 @@ void DynamicPropertiesModel::resetModel()
setHorizontalHeaderLabels(
QStringList({tr("Item"), tr("Property"), tr("Property Type"), tr("Property Value")}));
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
addModelNode(modelNode);
if (connectionView()->isAttached()) {
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
addModelNode(modelNode);
}
endResetModel();
}