From 62d7418a6b0ab9d0ac2a8671a61b9013336f1a0d Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Wed, 2 Oct 2024 09:42:36 +0200 Subject: [PATCH] Designsystem: Fix crash when generating QML Fixes: QDS-13777 Change-Id: I8a8896327ec8319d8bfde54a8dec5075355e7060 Reviewed-by: Marco Bubke Reviewed-by: Tim Jenssen --- .../qmldesigner/components/designsystem/dsthemegroup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/designsystem/dsthemegroup.cpp b/src/plugins/qmldesigner/components/designsystem/dsthemegroup.cpp index 4a26fef5ec9..a4b0158d460 100644 --- a/src/plugins/qmldesigner/components/designsystem/dsthemegroup.cpp +++ b/src/plugins/qmldesigner/components/designsystem/dsthemegroup.cpp @@ -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;