forked from qt-creator/qt-creator
QmlDesigner: Adjust regular expression
This is a heuristic to detect expressions and we should require at least a single "." to distinguish true/false and simple string literals. The implcit binding detection is not ideal, because there are still false positives. Task-number: QDS-12888 Change-Id: I23b5dd44ff3150f6d5a4ec94bd7a19b5e2117f5b Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -203,7 +203,7 @@ bool isBindingExpression(const QVariant &value)
|
||||
if (value.metaType().id() != QMetaType::QString)
|
||||
return false;
|
||||
|
||||
QRegularExpression regexp("^[a-z_]\\w*|^[A-Z]\\w*\\.{1}([a-z_]\\w*\\.?)+");
|
||||
QRegularExpression regexp("^[a-zA-Z_]\\w*\\.{1}([a-z_]\\w*\\.?)+");
|
||||
QRegularExpressionMatch match = regexp.match(value.toString());
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
Reference in New Issue
Block a user