PNP_PIbd-31_Rodionov_I_A_Co.../models/location.cpp
2024-12-24 18:02:23 +04:00

32 lines
450 B
C++

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