forked from DOMjudge/DOMjura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
problem.cpp
54 lines (46 loc) · 1.29 KB
/
problem.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "problem.h"
#include <QJsonObject>
namespace DJ
{
namespace Model
{
Problem::Problem(QJsonObject problem, QObject *parent) : QObject(parent)
{
this->id = problem.value("id").toString();
this->name = problem.value("name").toString("UNKNOWN");
this->shortname = problem.value("short_name").toString("?");
this->color = problem.value("color").toString();
this->rgb = problem.value("rgb").toString();
}
QString Problem::getId()
{
return this->id;
}
QString Problem::getName()
{
return this->name;
}
QString Problem::getShortName()
{
return this->shortname;
}
QString Problem::getColor()
{
return this->color;
}
QString Problem::getRGB()
{
return this->rgb;
}
QString Problem::toString()
{
QString s;
s += " id = " + this->id + "\n";
s += " name = " + this->name + "\n";
s += "shortname = " + this->shortname + "\n";
s += " color = " + this->color + "\n";
s += " rgb = " + this->rgb + "\n";
return s;
}
}
}