Gui: fix locale number formatting propagation

This commit is contained in:
0penBrain
2022-03-27 20:50:49 +02:00
committed by wwmayer
parent 650b2f3073
commit eb38017828
3 changed files with 7 additions and 9 deletions

View File

@@ -139,7 +139,7 @@ public:
{
try {
QString copy = str;
copy.remove(QLocale().groupSeparator());
copy.remove(locale.groupSeparator());
result = Base::Quantity::parse(copy);
value = result.getValue();
@@ -162,8 +162,6 @@ public:
const bool plus = max >= 0;
const bool minus = min <= 0;
auto locale = QLocale();
switch (len) {
case 0:
state = max != min ? QValidator::Intermediate : QValidator::Invalid;
@@ -292,6 +290,7 @@ end:
return res;
}
QLocale locale;
bool validInput;
bool pendingEmit;
QString validStr;
@@ -314,6 +313,7 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent)
ExpressionSpinBox(this),
d_ptr(new QuantitySpinBoxPrivate(this))
{
d_ptr->locale = locale();
this->setContextMenuPolicy(Qt::DefaultContextMenu);
QObject::connect(lineEdit(), SIGNAL(textChanged(QString)),
this, SLOT(userInput(QString)));