Use QLocale::toDouble instead of QString::toDouble in the length validator

Fixes: #9214
This commit is contained in:
Juergen Spitzmueller 2015-03-15 11:48:36 +01:00
parent d9626ec6af
commit 187c5f0ef5

View File

@ -40,8 +40,15 @@ LengthValidator::LengthValidator(QWidget * parent)
QValidator::State LengthValidator::validate(QString & qtext, int &) const QValidator::State LengthValidator::validate(QString & qtext, int &) const
{ {
QLocale loc;
bool ok; bool ok;
qtext.trimmed().toDouble(&ok); loc.toDouble(qtext.trimmed(), &ok);
if (!ok) {
// Fall back to C
QLocale c(QLocale::C);
c.toDouble(qtext.trimmed(), &ok);
}
if (qtext.isEmpty() || ok) if (qtext.isEmpty() || ok)
return QValidator::Acceptable; return QValidator::Acceptable;