#include "devicestructureelement.h" DeviceStructureElement::DeviceStructureElement() {} DeviceStructureElement::~DeviceStructureElement() {} QString DeviceStructureElement::nameModel() const { return _nameModel; } void DeviceStructureElement::setNameModel(const QString &newNameModel) { _nameModel = newNameModel; } QString DeviceStructureElement::nameManuf() const { return _nameManuf; } void DeviceStructureElement::setNameManuf(const QString &newNameManuf) { _nameManuf = newNameManuf; } QString DeviceStructureElement::description() const { return _description; } void DeviceStructureElement::setDescription(const QString &newDescription) { _description = newDescription; } QString DeviceStructureElement::nameType() const { return _nameType; } void DeviceStructureElement::setNameType(const QString &newNameType) { _nameType = newNameType; } int DeviceStructureElement::count() const { return _count; } void DeviceStructureElement::setCount(int newCount) { _count = newCount; } void DeviceStructureElement::fromJson(const QJsonObject &json) { setId(json["id"].toInt()); setNameModel(json["nameModel"].toString()); setNameManuf(json["nameManuf"].toString()); setDescription(json["description"].toString()); setNameType(json["nameType"].toString()); setCount(json["count"].toInt()); } QJsonObject DeviceStructureElement::toJson() const { QJsonObject obj; obj["id"] = id(); obj["nameModel"] = nameModel(); obj["nameManuf"] = nameManuf(); obj["description"] = description(); obj["nameType"] = nameType(); obj["count"] = count(); return obj; }