QmlDesigner: Convert translation functions

This converts the translation functions when dragging in items
from the library.

Task-number: QDS-7598
Change-Id: Iaed0f6683c2083e1d103ddfc07fe7ba2a2e9224c
Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
Thomas Hartmann
2022-09-08 12:16:24 +02:00
parent e9bea54139
commit 9aa5a4cc6c

View File

@@ -292,7 +292,8 @@ QmlObjectNode QmlVisualNode::createQmlObjectNode(AbstractView *view,
for (const auto &property : itemLibraryEntry.properties()) { for (const auto &property : itemLibraryEntry.properties()) {
if (property.type() == "binding") { if (property.type() == "binding") {
propertyBindingList.append(PropertyBindingEntry(property.name(), property.value().toString())); const QString value = QmlObjectNode::convertToCorrectTranslatableFunction(property.value().toString());
propertyBindingList.append(PropertyBindingEntry(property.name(), value));
} else if (property.type() == "enum") { } else if (property.type() == "enum") {
propertyEnumList.append(PropertyBindingEntry(property.name(), property.value().toString())); propertyEnumList.append(PropertyBindingEntry(property.name(), property.value().toString()));
} else if (property.value().toString() == QString::fromLatin1(imagePlaceHolder)) { } else if (property.value().toString() == QString::fromLatin1(imagePlaceHolder)) {