diff --git a/core/autotablemodel.h b/core/autotablemodel.h index f7ee949..1fd9aed 100644 --- a/core/autotablemodel.h +++ b/core/autotablemodel.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "../qdecimal/src/QDecDouble.hh" @@ -264,7 +265,14 @@ public: QSharedPointer entity = m_list.at(index.row()); QObject *rawEntity = (QObject*)entity.data(); - rawEntity->setProperty(rawEntity->metaObject()->property(index.column() + 1).name(), value); + QVariant val = value; + if (rawEntity->property(rawEntity->metaObject()->property(index.column() + 1).name()).canConvert()) + { + QDecDouble dec(val.toDouble()); + val = QVariant::fromValue(dec); + } + + rawEntity->setProperty(rawEntity->metaObject()->property(index.column() + 1).name(), val); } if (role == Qt::CheckStateRole)