From d40fcd9017ccb441c1859606c6c2583c13ac5866 Mon Sep 17 00:00:00 2001 From: Steru Date: Fri, 16 Aug 2024 15:39:05 +0200 Subject: Fixed constructors. --- src/model/Competitor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/model/Competitor.h') diff --git a/src/model/Competitor.h b/src/model/Competitor.h index 79552a5..1913325 100644 --- a/src/model/Competitor.h +++ b/src/model/Competitor.h @@ -5,6 +5,7 @@ #include #include #include +#include using namespace std; @@ -18,9 +19,7 @@ class Competitor : public QObject { Q_PROPERTY(QString noc READ noc NOTIFY nNoc) public: - Competitor() : m_code(0), m_name(""), m_noc("") {} - Competitor(const Competitor &competitor) : m_code(competitor.m_code), m_name(competitor.m_name), m_noc(competitor.m_noc) {} - Competitor(const QJsonObject &competitor) { setCompetitor(competitor); } + explicit Competitor(QObject *parent) : QObject(parent) {} int getCode() { return this->m_code; } QString getName() { return this->m_name; } @@ -31,6 +30,7 @@ public: void setNOC(QString noc) { this->m_noc = noc; } bool setCompetitor(const QJsonObject &competitor); + bool setCompetitor(const Competitor &competitor); static bool compareName(const Competitor &left, const Competitor &right) { return left.m_name.compare(right.m_name) < 0; -- cgit v1.2.3