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 492a726497
commit 4f12d941f9
5 changed files with 18 additions and 39 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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