PNP_PIbd-31_Rodionov_I_A_Co.../models/manufacturer.cpp
2024-12-24 18:13:22 +04:00

32 lines
486 B
C++

#include "manufacturer.h"
Manufacturer::Manufacturer()
{}
Manufacturer::~Manufacturer()
{}
QString Manufacturer::name() const
{
return _name;
}
void Manufacturer::setName(const QString &newName)
{
_name = newName;
}
void Manufacturer::fromJson(const QJsonObject &json)
{
setId(json["id"].toInt());
setName(json["name"].toString());
}
QJsonObject Manufacturer::toJson() const
{
QJsonObject obj;
obj["id"] = id();
obj["name"] = name();
return obj;
}