Added pragma once to headers and notify to Q Params.

This commit is contained in:
Steru 2024-08-15 21:00:18 +02:00
parent c527aec94d
commit b49c066bd5
5 changed files with 18 additions and 39 deletions

View file

@ -1,7 +1,5 @@
#ifndef ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H #pragma once
#define ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H
#define API_LINK "https://sph-s-api.olympics.com/summer/schedules/api/ENG/schedule/discipline/" #define API_LINK "https://sph-s-api.olympics.com/summer/schedules/api/ENG/schedule/discipline/"
@ -72,6 +70,3 @@ public:
string getDisciplineShort(Disciplines sport); string getDisciplineShort(Disciplines sport);
}; };
#endif //ITAT_CHALLANGE_OLYMPICS_OLYMPICSAPI_H

View file

@ -1,12 +1,10 @@
#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H #pragma once
#define ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
#include <QString> #include <QString>
#include <QMap> #include <QMap>
#include <QJsonObject> #include <QJsonObject>
#include <QAbstractListModel> #include <QAbstractListModel>
#include <stdexcept>
using namespace std; using namespace std;
@ -14,15 +12,15 @@ class Competitor {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int code READ code) Q_PROPERTY(int code READ code NOTIFY nCode)
Q_PROPERTY(QString name READ name) Q_PROPERTY(QString name READ name NOTIFY nName)
Q_PROPERTY(QString noc READ noc) Q_PROPERTY(QString noc READ noc NOTIFY nNoc)
public: public:
Competitor() { Competitor() {
this->code = 0; this->code = 0;
this->name = "na"; this->name = "";
this->noc = "---"; this->noc = "";
} }
Competitor(const Competitor &competitor) { Competitor(const Competitor &competitor) {
@ -58,6 +56,3 @@ private:
QString noc; QString noc;
}; };
#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H

View file

@ -1,6 +1,5 @@
#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H #pragma once
#define ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H
#include "Competitor.h" #include "Competitor.h"
#include <QString> #include <QString>
@ -13,14 +12,14 @@ class CompetitorWithResults : public Competitor {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString mark READ mark) Q_PROPERTY(QString mark READ mark NOTIFY nMark)
Q_PROPERTY(QString medalType READ medalType) Q_PROPERTY(QString medalType READ medalType NOTIFY nMedalType)
Q_PROPERTY(QString statistic READ statistic WRITE setStatistic) Q_PROPERTY(QString statistic READ statistic NOTIFY nStatistic)
public: public:
CompetitorWithResults() : Competitor() { CompetitorWithResults() : Competitor() {
this->mark = "-"; this->mark = "";
this->medalType = "-"; this->medalType = "";
} }
CompetitorWithResults(const CompetitorWithResults &competitor) : Competitor(competitor) { CompetitorWithResults(const CompetitorWithResults &competitor) : Competitor(competitor) {
@ -49,6 +48,3 @@ private:
QString statistic; QString statistic;
}; };
#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITORWITHRESULTS_H

View file

@ -1,6 +1,5 @@
#ifndef ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H #pragma once
#define ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H
#include "Competitor.h" #include "Competitor.h"
#include <QMap> #include <QMap>
@ -12,9 +11,9 @@
class MedalWinner : public Competitor { class MedalWinner : public Competitor {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int gold READ gold) Q_PROPERTY(int gold READ gold NOTIFY nGold)
Q_PROPERTY(int silver READ silver) Q_PROPERTY(int silver READ silver NOTIFY nSilver)
Q_PROPERTY(int bronze READ bronze) Q_PROPERTY(int bronze READ bronze NOTIFY nBronze)
public: public:
MedalWinner() : Competitor() { MedalWinner() : Competitor() {
@ -46,6 +45,3 @@ private:
int gold, silver, bronze; int gold, silver, bronze;
}; };
#endif //ITAT_CHALLANGE_OLYMPICS_MEDALWINNER_H

View file

@ -1,5 +1,4 @@
#ifndef ITAT_CHALLANGE_OLYMPICS_SPORT_H #pragma once
#define ITAT_CHALLANGE_OLYMPICS_SPORT_H
#include "MedalWinner.h" #include "MedalWinner.h"
#include "CompetitorWithResults.h" #include "CompetitorWithResults.h"
@ -123,5 +122,3 @@ private:
float calcRelativeStat(QString ref, QString val); float calcRelativeStat(QString ref, QString val);
}; };
#endif