]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #586: Paprameter name suffixed by a digit -- Use localization decimal point...
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 3 Jun 2015 07:28:09 +0000 (10:28 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 3 Jun 2015 07:29:29 +0000 (10:29 +0300)
src/ModuleBase/ModuleBase_ParamSpinBox.cpp

index dd3eebd30c9c8d5fbac839adace8a0c1acb183b6..5e59599a3c42b943aa5057b24cb82ae078c2635c 100644 (file)
@@ -8,8 +8,9 @@
 
 #include <QKeyEvent>
 #include <QLineEdit>
-#include <QToolTip>
+#include <QLocale>
 #include <QRegExp>
+#include <QToolTip>
 
 #include <string>
 #include <iostream>
@@ -164,8 +165,9 @@ bool ModuleBase_ParamSpinBox::hasVariable() const
 
 bool ModuleBase_ParamSpinBox::hasVariable(const QString& theText) const
 {
-  //QRegExp varNameMask("[-+]?[0-9]*[.]?[0-9]+([eE][-+]?[0-9]+)?"); //This row causes problem with input in sketcher (circle)
-  QRegExp varNameMask("[-+]?[0-9]*.?[0-9]+([eE][-+]?[0-9]+)?");
+  QString aPattern = QString("[-+]?[0-9]*[%1]?[0-9]+([eE][-+]?[0-9]+)?")
+      .arg(QLocale::system().decimalPoint());
+  QRegExp varNameMask(aPattern);
   return !varNameMask.exactMatch(theText);
 }