This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/DataModel.cpp

22 lines
409 B
C++
Raw Normal View History

2018-05-16 05:02:12 +00:00
#include "DataModel.h"
DataModel::DataModel(QObject *parent) : QObject(parent), m_metaData(this)
{
}
void DataModel::write(QJsonObject &target) const
{
QJsonObject metaData;
m_metaData.write(metaData);
target["MetaData"] = metaData;
}
void DataModel::read(const QJsonObject &source)
{
const auto &metaData = source["MetaData"];
if (metaData.isObject())
{
m_metaData.read(metaData.toObject());
}
}