Previous patch failed with GUI conversion
This commit is contained in:
parent
a987c09d5d
commit
a65ee9c24f
|
@ -32,7 +32,7 @@ void FloatDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
|||
QLineEdit *line = qobject_cast<QLineEdit *>(editor);
|
||||
QString s ;
|
||||
bool ok;
|
||||
double value = line->text().replace(".", "").toInt(&ok);
|
||||
double value = line->text().toDouble(&ok);
|
||||
if (ok)
|
||||
model->setData(index, qVariantFromValue(s.sprintf("%.2lf", value)));
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void FormulaDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
|||
}
|
||||
else
|
||||
{
|
||||
res = value.replace(".", "").toInt(&ok);
|
||||
res = value.toDouble(&ok);
|
||||
if (ok)
|
||||
model->setData(index, qVariantFromValue(s.sprintf("%.2lf", res)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user