summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-15 21:00:18 +0200
committerOrangerot <purple@orangerot.dev>2024-08-26 11:19:38 +0200
commitdb2d0c21c48698d336ac6e60c42cc2533648b51d (patch)
tree175c64996085a53025978248f3244f9eeb28c26c /src/model
parentdf2cd325395886868e64c4d96ba7a959ef7d204e (diff)
Added pragma once to headers and notify to Q Params.
Diffstat (limited to 'src/model')
-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
4 files changed, 17 insertions, 33 deletions
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 2ca83a3..c5d1c66 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"
@@ -126,5 +125,3 @@ private:
float calcRelativeStat(QString ref, QString val);
};
-
-#endif