1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 08:23:52 +00:00
openmw/apps/opencs/model/world/columns.hpp
2012-11-29 14:45:34 +01:00

33 lines
No EOL
724 B
C++

#ifndef CSM_WOLRD_COLUMNS_H
#define CSM_WOLRD_COLUMNS_H
#include "idcollection.hpp"
namespace CSMWorld
{
template<typename ESXRecordT>
struct FloatValueColumn : public Column<ESXRecordT>
{
FloatValueColumn() : Column<ESXRecordT> ("Value") {}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return record.get().mValue;
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT base = record.getBase();
base.mValue = data.toFloat();
record.setModified (base);
}
virtual bool isEditable() const
{
return true;
}
};
}
#endif