- //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]+)?");
- return !varNameMask.exactMatch(theText);
+ //const QString aDigitPattern = QString("[-+]?[0-9]*[%1]?[0-9]*([eE][-+]?[0-9]+)?");
+
+ //bool aHasDigit = false;
+ //{
+ // QRegExp varNameMask(aDigitPattern.arg("."));
+ // aHasDigit = varNameMask.exactMatch(theText);
+ //}
+ //if (!aHasDigit)
+ //{
+ // QRegExp varNameMask(aDigitPattern.arg(","));
+ // aHasDigit = varNameMask.exactMatch(theText);
+ //}
+ bool isDouble = false;
+ QLocale::c().toDouble(theText, &isDouble);
+
+// theText.toDouble(&isDouble);
+// if (isDouble) {
+// QLocale aLoc; // create default locale
+// QChar aDecPnt = aLoc.decimalPoint();
+// if (aDecPnt == '.')
+// isDouble = theText.contains(aDecPnt) || (!theText.contains(','));
+// else if (aDecPnt == ',')
+// isDouble = theText.contains(aDecPnt) || (!theText.contains('.'));
+// }
+ return !isDouble;