diff options
author | Steru <jerrydream111@gmail.com> | 2024-08-16 15:39:05 +0200 |
---|---|---|
committer | Steru <jerrydream111@gmail.com> | 2024-08-16 23:53:31 +0200 |
commit | b825a98d95dd9fa432a161d95eb6454536e01af4 (patch) | |
tree | 4a55a4f3907d8843cf56eabcbda6629266499123 /src/model/Competitor.h | |
parent | b869b8983656b12f9dee59439acfb6b3db647b72 (diff) |
Fixed constructors.
Diffstat (limited to 'src/model/Competitor.h')
-rw-r--r-- | src/model/Competitor.h | 6 |
1 files changed, 3 insertions, 3 deletions
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 <QMap> #include <QJsonObject> #include <QObject> +#include <qqml.h> 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; |