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