diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index 0178def70..34e629328 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -194,7 +194,7 @@ void Calculator::InitCharacterSets() // Defining identifier character sets DefineNameChars(QStringLiteral("0123456789_") + symbols.join("")); - DefineOprtChars(symbols.join("") + QStringLiteral("+-*^/?<>=#!$%&|~'_")); + DefineOprtChars(symbols.join("") + QStringLiteral("+-*^/?<>=#!$%&|~_")); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 3280a5897..dca1e7965 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -732,7 +732,10 @@ void DialogTool::NamePointChanged() { QString name = edit->text(); name.replace(" ", ""); - if (name.isEmpty() || (pointName != name && data->IsUnique(name) == false)) + QRegExpValidator v(QRegExp(nameRegExp), this); + int pos = 0; + if (name.isEmpty() || (pointName != name && data->IsUnique(name) == false) || + v.validate(name, pos) == QValidator::Invalid) { flagName = false; ChangeColor(labelEditNamePoint, Qt::red); diff --git a/src/app/options.cpp b/src/app/options.cpp index 90d97978e..0f102247f 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -31,7 +31,7 @@ #include //Same regexp in pattern.xsd shema file. Don't forget synchronize. -const QString nameRegExp = QStringLiteral("^([^0-9-*/^+=\\s\\(\\)%:;!.,]){1,1}([^-*/^+=\\s\\(\\)%:;!.,]){0,}$"); +const QString nameRegExp = QStringLiteral("^([^0-9-*/^+=\\s\\(\\)%:;!.,`'\"]){1,1}([^-*/^+=\\s\\(\\)%:;!.,`'\"]){0,}$"); // From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This // furthermore blows up the binary sizes.