Designsystem: Fix crash when generating QML

Fixes: QDS-13777
Change-Id: I8a8896327ec8319d8bfde54a8dec5075355e7060
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Vikas Pachdha
2024-10-02 09:42:36 +02:00
parent 88ecbbd425
commit 62d7418a6b

View File

@@ -155,7 +155,7 @@ void DSThemeGroup::decorate(ThemeId theme, ModelNode themeNode, DECORATION_CONTE
if (!count(theme))
return; // No props for this theme in this group.
ModelNode *targetNode = &themeNode;
ModelNode targetNode = themeNode;
const auto typeName = groupTypeName(m_type);
if (decorationContext == DECORATION_CONTEXT::MPU) {
@@ -169,7 +169,7 @@ void DSThemeGroup::decorate(ThemeId theme, ModelNode themeNode, DECORATION_CONTE
return;
}
groupProperty.setDynamicTypeNameAndsetModelNode("QtObject", groupNode);
targetNode = &groupNode;
targetNode = groupNode;
}
// Add properties
@@ -179,12 +179,12 @@ void DSThemeGroup::decorate(ThemeId theme, ModelNode themeNode, DECORATION_CONTE
if (themeValue != values.end()) {
auto &propData = themeValue->second;
if (propData.isBinding) {
auto bindingProp = targetNode->bindingProperty(propName);
auto bindingProp = targetNode.bindingProperty(propName);
if (bindingProp)
bindingProp.setDynamicTypeNameAndExpression(*typeName,
propData.value.toString());
} else {
auto nodeProp = targetNode->variantProperty(propName);
auto nodeProp = targetNode.variantProperty(propName);
if (!nodeProp)
continue;