forked from qt-creator/qt-creator
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:
@@ -56,8 +56,10 @@ void BindingModel::resetModel()
|
|||||||
setHorizontalHeaderLabels(
|
setHorizontalHeaderLabels(
|
||||||
QStringList({tr("Item"), tr("Property"), tr("Source Item"), tr("Source Property")}));
|
QStringList({tr("Item"), tr("Property"), tr("Source Item"), tr("Source Property")}));
|
||||||
|
|
||||||
|
if (connectionView()->isAttached()) {
|
||||||
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
|
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
|
||||||
addModelNode(modelNode);
|
addModelNode(modelNode);
|
||||||
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,8 +131,10 @@ void DynamicPropertiesModel::resetModel()
|
|||||||
setHorizontalHeaderLabels(
|
setHorizontalHeaderLabels(
|
||||||
QStringList({tr("Item"), tr("Property"), tr("Property Type"), tr("Property Value")}));
|
QStringList({tr("Item"), tr("Property"), tr("Property Type"), tr("Property Value")}));
|
||||||
|
|
||||||
|
if (connectionView()->isAttached()) {
|
||||||
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
|
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
|
||||||
addModelNode(modelNode);
|
addModelNode(modelNode);
|
||||||
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user