Commit 35e36f75 authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlDesigner: Fix crash in TestCore::testRewriterForArrayMagic

Qml allows property lists to be written as single properties, i.e.

  states: State {}

However, for the QmlDesigner model states is a list. Take care of this
in the texttomodelmerger.

Reviewed-by: Erik Verbruggen
parent f956b52e
......@@ -382,7 +382,12 @@ void TextToModelMerger::syncNode(ModelNode &modelNode,
} else {
if (isValidPropertyForNode(modelNode, astPropertyName)) {
AbstractProperty modelProperty = modelNode.property(astPropertyName);
syncNodeProperty(modelProperty, binding, context, differenceHandler);
if (modelProperty.metaInfo().isListProperty()) {
NodeListProperty listProperty = modelProperty.toNodeListProperty();
syncNodeListProperty(listProperty, QList<QmlJS::AST::UiObjectMember*>() << member, context, differenceHandler);
} else {
syncNodeProperty(modelProperty, binding, context, differenceHandler);
}
modelPropertyNames.remove(astPropertyName);
} else {
qWarning() << "Skipping invalid node property" << astPropertyName
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment