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:
Thomas Hartmann
2024-06-05 17:14:47 +02:00
parent f6988e8319
commit 8f58dc6de9

View File

@@ -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();
}