summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/api/OlympicsAPI.h7
-rw-r--r--src/model/Competitor.h17
-rw-r--r--src/model/CompetitorWithResults.h16
-rw-r--r--src/model/MedalWinner.h12
-rw-r--r--src/model/Sport.h5
5 files changed, 18 insertions, 39 deletions
diff --git a/src/api/OlympicsAPI.h b/src/api/OlympicsAPI.h
index f1168b6..a301cf8 100644
--- a/src/api/OlympicsAPI.h
+++ b/src/api/OlympicsAPI.h
@@ -1,7 +1,5 @@
-#ifndef ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H
-#define ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H
-
+#pragma once
#define API_LINK "https://sph-s-api.olympics.com/summer/schedules/api/ENG/schedule/discipline/"
@@ -72,6 +70,3 @@ public:
string getDisciplineShort(Disciplines sport);
};
-
-
-#endif //ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H
diff --git a/src/model/Competitor.h b/src/model/Competitor.h
index e5b0251..51fc3b1 100644
--- a/src/model/Competitor.h
+++ b/src/model/Competitor.h
@@ -1,12 +1,10 @@
-#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
-#define ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
+#pragma once
#include <QString>
#include <QMap>
#include <QJsonObject>
#include <QAbstractListModel>
-#include <stdexcept>
using namespace std;
@@ -14,15 +12,15 @@ class Competitor {
Q_OBJECT
- Q_PROPERTY(int code READ code)
- Q_PROPERTY(QString name READ name)
- Q_PROPERTY(QString noc READ noc)
+ Q_PROPERTY(int code READ code NOTIFY nCode)
+ Q_PROPERTY(QString name READ name NOTIFY nName)
+ Q_PROPERTY(QString noc READ noc NOTIFY nNoc)
public:
Competitor() {
this->code = 0;
- this->name = "na";
- this->noc = "---";
+ this->name = "";
+ this->noc = "";
}
Competitor(const Competitor &competitor) {
@@ -58,6 +56,3 @@ private:
QString noc;
};
-
-
-#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
diff --git a/src/model/CompetitorWithResults.h b/src/model/CompetitorWithResults.h
index f57b773..a58023f 100644
--- a/src/model/CompetitorWithResults.h
+++ b/src/model/CompetitorWithResults.h
@@ -1,6 +1,5 @@
-#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H
-#define ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H
+#pragma once
#include "Competitor.h"
#include <QString>
@@ -13,14 +12,14 @@ class CompetitorWithResults : public Competitor {
Q_OBJECT
- Q_PROPERTY(QString mark READ mark)
- Q_PROPERTY(QString medalType READ medalType)
- Q_PROPERTY(QString statistic READ statistic WRITE setStatistic)
+ Q_PROPERTY(QString mark READ mark NOTIFY nMark)
+ Q_PROPERTY(QString medalType READ medalType NOTIFY nMedalType)
+ Q_PROPERTY(QString statistic READ statistic NOTIFY nStatistic)
public:
CompetitorWithResults() : Competitor() {
- this->mark = "-";
- this->medalType = "-";
+ this->mark = "";
+ this->medalType = "";
}
CompetitorWithResults(const CompetitorWithResults &competitor) : Competitor(competitor) {
@@ -49,6 +48,3 @@ private:
QString statistic;
};
-
-
-#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H
diff --git a/src/model/MedalWinner.h b/src/model/MedalWinner.h
index 99ca1a3..7f17449 100644
--- a/src/model/MedalWinner.h
+++ b/src/model/MedalWinner.h
@@ -1,6 +1,5 @@
-#ifndef ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H
-#define ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H
+#pragma once
#include "Competitor.h"
#include <QMap>
@@ -12,9 +11,9 @@
class MedalWinner : public Competitor {
Q_OBJECT
- Q_PROPERTY(int gold READ gold)
- Q_PROPERTY(int silver READ silver)
- Q_PROPERTY(int bronze READ bronze)
+ Q_PROPERTY(int gold READ gold NOTIFY nGold)
+ Q_PROPERTY(int silver READ silver NOTIFY nSilver)
+ Q_PROPERTY(int bronze READ bronze NOTIFY nBronze)
public:
MedalWinner() : Competitor() {
@@ -46,6 +45,3 @@ private:
int gold, silver, bronze;
};
-
-
-#endif //ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H
diff --git a/src/model/Sport.h b/src/model/Sport.h
index 7b2f3b0..227d75c 100644
--- a/src/model/Sport.h
+++ b/src/model/Sport.h
@@ -1,5 +1,4 @@
-#ifndef ITAT_CHALLANGE_OLYMPICS_SPORT_H
-#define ITAT_CHALLANGE_OLYMPICS_SPORT_H
+#pragma once
#include "MedalWinner.h"
#include "CompetitorWithResults.h"
@@ -123,5 +122,3 @@ private:
float calcRelativeStat(QString ref, QString val);
};
-
-#endif