QmlDesigner: Don't copy/remove data property when copying all

'data' property contains node's children, so it should be ignored
during the 'copy all properties' operation.

Change-Id: Ib056409c9ad0a42ebc40f751173b7a3455d912c6
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-10-21 13:36:29 +03:00
parent bad166cda8
commit f496970002
2 changed files with 2 additions and 1 deletions

View File

@@ -403,6 +403,7 @@ void MaterialBrowserModel::copyMaterialProperties(int idx, const QString &sectio
} }
} }
validProps.remove("objectName"); validProps.remove("objectName");
validProps.remove("data");
if (m_allPropsCopied || dynamicPropsCopied || m_propertyGroupsObj.empty()) { if (m_allPropsCopied || dynamicPropsCopied || m_propertyGroupsObj.empty()) {
copiedProps = validProps.values(); copiedProps = validProps.values();

View File

@@ -123,7 +123,7 @@ WidgetInfo MaterialBrowserView::widgetInfo()
} }
} }
for (const PropertyName &propName : qAsConst(propNames)) { for (const PropertyName &propName : qAsConst(propNames)) {
if (propName != "objectName") if (propName != "objectName" && propName != "data")
mat.removeProperty(propName); mat.removeProperty(propName);
} }
} }