+ proper handling of group separator in InputField and QuantitySpinBox

This commit is contained in:
wmayer
2014-07-21 15:03:45 +02:00
parent 7b53b556fa
commit dbddf8bbda
4 changed files with 19 additions and 5 deletions

View File

@@ -180,7 +180,9 @@ void InputField::newInput(const QString & text)
{
Quantity res;
try {
res = Quantity::parse(text);
QString input = text;
input.remove(locale().groupSeparator());
res = Quantity::parse(input);
}
catch(Base::Exception &e){
ErrorText = e.what();
@@ -524,13 +526,16 @@ void InputField::wheelEvent (QWheelEvent * event)
void InputField::fixup(QString& input) const
{
input.remove(locale().groupSeparator());
}
QValidator::State InputField::validate(QString& input, int& pos) const
{
try {
Quantity res;
res = Quantity::parse(input);
QString text = input;
text.remove(locale().groupSeparator());
res = Quantity::parse(text);
double factor;
QString unitStr;