summaryrefslogtreecommitdiff
path: root/src/model/Competitor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/Competitor.h')
-rw-r--r--src/model/Competitor.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/model/Competitor.h b/src/model/Competitor.h
index 919c2fa..1121a5b 100644
--- a/src/model/Competitor.h
+++ b/src/model/Competitor.h
@@ -5,13 +5,26 @@
#include <QString>
#include <QMap>
#include <QJsonObject>
+#include <QAbstractListModel>
#include <stdexcept>
using namespace std;
class Competitor {
+ Q_OBJECT
+
+ Q_PROPERTY(int code READ code)
+ Q_PROPERTY(QString name READ name)
+ Q_PROPERTY(QString noc READ noc)
+
public:
+ Competitor() {
+ this->code = 0;
+ this->name = "na";
+ this->noc = "---";
+ }
+
Competitor(const Competitor &competitor) {
this->code = competitor.code;
this->name = competitor.name;
@@ -22,14 +35,14 @@ public:
setCompetitor(competitor);
}
- QString getCode() { return this->code; }
+ int getCode() { return this->code; }
QString getName() { return this->name; }
QString getNOC() { return this->noc; }
bool setCompetitor(const QJsonObject &competitor);
private:
- QString code;
+ int code;
QString name;
QString noc;