32 lines
450 B
C++
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;
|
||
|
}
|