Commit 299dc85b authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

hopefully fixed acquistions öre problem

parent 942aadb8
#include "moneydelegate.h"
#include <QtCore>
#include <QLineEdit>
MoneyDelegate::MoneyDelegate(int decimals, double min, double max, QObject* parent)
......@@ -25,8 +24,8 @@ void MoneyDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, con
{
QLocale swedish(QLocale::Swedish);
if (QLineEdit* ed = qobject_cast<QLineEdit*>(editor)) {
int data = swedish.toDouble(ed->text()) * 100;
model->setData(index, QVariant(data), Qt::EditRole);
QVariant data = swedish.toDouble(ed->text()) * 100;
model->setData(index, data, Qt::EditRole);
} else
ValidatorDelegate::setModelData(editor, model, index);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment