forked from qt-creator/qt-creator
QmlDesigner: Fix regular expression
We have to use a non capturing group for the optional 'Id'. Change-Id: I59431d78908a16f571febdf14c57bfe079ca6817 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
ecbd1fa408
commit
7c3f61f819
@@ -189,7 +189,7 @@ bool QmlObjectNode::isTranslatableText(const PropertyName &name) const
|
||||
if (modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name))
|
||||
if (modelNode().metaInfo().propertyTypeName(name) == "QString" || modelNode().metaInfo().propertyTypeName(name) == "string") {
|
||||
if (modelNode().hasBindingProperty(name)) {
|
||||
static QRegExp regularExpressionPatter(QLatin1String("qsTr(|Id)\\((\".*\")\\)"));
|
||||
static QRegExp regularExpressionPatter(QLatin1String("qsTr(?:|Id)\\((\".*\")\\)"));
|
||||
return regularExpressionPatter.exactMatch(modelNode().bindingProperty(name).expression());
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ bool QmlObjectNode::isTranslatableText(const PropertyName &name) const
|
||||
QString QmlObjectNode::stripedTranslatableText(const PropertyName &name) const
|
||||
{
|
||||
if (modelNode().hasBindingProperty(name)) {
|
||||
static QRegExp regularExpressionPatter(QLatin1String("qsTr(|Id)\\(\"(.*)\"\\)"));
|
||||
static QRegExp regularExpressionPatter(QLatin1String("qsTr(?:|Id)\\(\"(.*)\"\\)"));
|
||||
if (regularExpressionPatter.exactMatch(modelNode().bindingProperty(name).expression()))
|
||||
return regularExpressionPatter.cap(1);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user