QmlDesigner: Do not allow print as id

Task-number: QDS-4162
Change-Id: I7cce6fbeabff35e1d4469c93c73b02b56ff6d4a5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2021-04-14 19:04:16 +02:00
parent 0337b34bc2
commit d8737ffff4

View File

@@ -151,36 +151,14 @@ QString ModelNode::validId()
static bool idIsQmlKeyWord(const QString& id)
{
static const QSet<QString> keywords = {
"as",
"break",
"case",
"catch",
"continue",
"debugger",
"default",
"delete",
"do",
"else",
"finally",
"for",
"function",
"if",
"import",
"in",
"instanceof",
"new",
"return",
"switch",
"this",
"throw",
"try",
"typeof",
"var",
"void",
"while",
"with"
};
static const QSet<QString> keywords = {"as", "break", "case", "catch",
"continue", "debugger", "default", "delete",
"do", "else", "finally", "for",
"function", "if", "import", "in",
"instanceof", "new", "print", "return",
"switch", "this", "throw", "try",
"typeof", "var", "void", "while",
"with"};
return keywords.contains(id);
}