From cc67fe289774f4f0bc5fbf389140b4aeb705e76c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 5 Jun 2023 14:30:16 +0200 Subject: [PATCH] QmlDesigner: Take '.' properties into account in convertToVariant What we call dot properties have two styles. something.x something { x: ... } In the second case the prefix is set, because in the model we always normalize the syntax to the first case. toString() properly walks the array to collect the full identifier, instead of just taking the base property name. Before we were using e.g. 'eulerRotation' as the property type and tried to convert a single float to a vector3D. The new code uses thefull property name 'eulerRoation.x' and the conversion succeeds. Task-number: QDS-10027 Change-Id: I7210558db6a0f91f5f1a25b719df06beb70c5b83 Reviewed-by: Miikka Heikkinen --- .../qmldesigner/designercore/model/texttomodelmerger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 515d4043643..7328ae01aa6 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -609,8 +609,10 @@ public: const QString &propertyPrefix, AST::UiQualifiedId *propertyId) { - const QString propertyName = propertyPrefix.isEmpty() ? propertyId->name.toString() - : propertyPrefix; + const QString propertyName = propertyPrefix.isEmpty() + ? toString(propertyId) + : propertyPrefix + "." + toString(propertyId); + const PropertyMetaInfo propertyMetaInfo = node.metaInfo().property(propertyName.toUtf8()); const bool hasQuotes = astValue.trimmed().left(1) == QStringLiteral("\"")