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 "moneydelegate.h"
#include <QtCore>
#include <QLineEdit> #include <QLineEdit>
MoneyDelegate::MoneyDelegate(int decimals, double min, double max, QObject* parent) MoneyDelegate::MoneyDelegate(int decimals, double min, double max, QObject* parent)
...@@ -25,8 +24,8 @@ void MoneyDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, con ...@@ -25,8 +24,8 @@ void MoneyDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, con
{ {
QLocale swedish(QLocale::Swedish); QLocale swedish(QLocale::Swedish);
if (QLineEdit* ed = qobject_cast<QLineEdit*>(editor)) { if (QLineEdit* ed = qobject_cast<QLineEdit*>(editor)) {
int data = swedish.toDouble(ed->text()) * 100; QVariant data = swedish.toDouble(ed->text()) * 100;
model->setData(index, QVariant(data), Qt::EditRole); model->setData(index, data, Qt::EditRole);
} else } else
ValidatorDelegate::setModelData(editor, model, index); 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