Fixed saving of enums to json settings. Added global enum for rounding.

master
Josef Rokos 8 years ago
parent 78c80199b2
commit 87ec7098ff

@ -9,6 +9,7 @@ class CORESHARED_EXPORT Enums : public QObject
Q_OBJECT
Q_ENUMS(VatType)
Q_ENUMS(Rounding)
public:
enum VatType
@ -19,6 +20,14 @@ public:
SECOND_LOWER
};
enum Rounding
{
R_NONE,
R_UP,
R_DOWN,
R_MATH
};
Enums()
{
}

@ -8,6 +8,7 @@
#include <QMetaProperty>
#include <QDecDouble.hh>
#include <QDebug>
#include "data/system.h"
#include "service.h"
@ -50,8 +51,19 @@ public:
{
QDecDouble dec(TO_DEC(varVal.toInt()));
varVal = QVariant::fromValue(dec);
objSettings->setProperty(propName, varVal);
continue;
}
// all other numbers are int
if (varVal.toInt() > 0)
{
objSettings->setProperty(propName, varVal.toInt());
}
else
{
objSettings->setProperty(propName, varVal);
}
objSettings->setProperty(propName, varVal);
}
return settingsObj;

Loading…
Cancel
Save