From b9349b9c221f866fb0d184d92ab74d2a73ec23ad Mon Sep 17 00:00:00 2001 From: Rafal Stawarski Date: Tue, 11 Mar 2025 10:44:45 +0100 Subject: [PATCH] PropertyEditorValue: improvement for isTranslated isTranslated needs to take into account dynamic properties as well so the highlight of 'tr' button works properly for translated dynamic properties in the property editor. Task-number: QDS-13513 Change-Id: I8694dc0b3b3d02351868fbe9a0777c6e4f1b6ee5 Reviewed-by: Tim Jenssen --- .../propertyeditor/propertyeditorvalue.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 01b18a08709..1828e891727 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -222,9 +222,15 @@ void PropertyEditorValue::setIsValid(bool valid) bool PropertyEditorValue::isTranslated() const { if (modelNode().isValid()) { - if (auto metaInfo = modelNode().metaInfo(); - metaInfo.isValid() && metaInfo.hasProperty(name()) - && metaInfo.property(name()).propertyType().isString()) { + auto metaInfo = modelNode().metaInfo(); + auto isString = metaInfo.isValid() && metaInfo.hasProperty(name()) + && metaInfo.property(name()).propertyType().isString(); + + auto property = modelNode().property(name()); + auto isDynamicString = property.isValid() && property.isDynamic() + && property.dynamicTypeName() == TypeNameView("string"); + + if (isString || isDynamicString) { const QmlObjectNode objectNode(modelNode()); if (objectNode.hasBindingProperty(name())) { const QRegularExpression rx(