forked from qt-creator/qt-creator
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: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -222,9 +222,15 @@ void PropertyEditorValue::setIsValid(bool valid)
|
|||||||
bool PropertyEditorValue::isTranslated() const
|
bool PropertyEditorValue::isTranslated() const
|
||||||
{
|
{
|
||||||
if (modelNode().isValid()) {
|
if (modelNode().isValid()) {
|
||||||
if (auto metaInfo = modelNode().metaInfo();
|
auto metaInfo = modelNode().metaInfo();
|
||||||
metaInfo.isValid() && metaInfo.hasProperty(name())
|
auto isString = metaInfo.isValid() && metaInfo.hasProperty(name())
|
||||||
&& metaInfo.property(name()).propertyType().isString()) {
|
&& 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());
|
const QmlObjectNode objectNode(modelNode());
|
||||||
if (objectNode.hasBindingProperty(name())) {
|
if (objectNode.hasBindingProperty(name())) {
|
||||||
const QRegularExpression rx(
|
const QRegularExpression rx(
|
||||||
|
Reference in New Issue
Block a user