mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Use QLocale::toDouble instead of QString::toDouble in the length validator
Fixes: #9214
This commit is contained in:
parent
d9626ec6af
commit
187c5f0ef5
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user