From c527aec94dafdf8c05cc9c0e822681a748790518 Mon Sep 17 00:00:00 2001 From: Steru Date: Thu, 15 Aug 2024 20:41:08 +0200 Subject: Reworked Sport class to work with QObjects instead of JSON objects. --- src/model/Competitor.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/model/Competitor.h') diff --git a/src/model/Competitor.h b/src/model/Competitor.h index 1121a5b..e5b0251 100644 --- a/src/model/Competitor.h +++ b/src/model/Competitor.h @@ -39,8 +39,19 @@ public: QString getName() { return this->name; } QString getNOC() { return this->noc; } + void setCode(int code) { this->code = code; } + void setName(QString name) { this->name = name; } + void setNOC(QString noc) { this->noc = noc; } + bool setCompetitor(const QJsonObject &competitor); + static bool compareName(const Competitor &left, const Competitor &right) { + return left.name.compare(right.name) < 0; + } + static bool compareNOC(const Competitor &left, const Competitor &right) { + return left.noc.compare(right.noc) < 0; + } + private: int code; QString name; -- cgit v1.2.3