#pragma once #include #include #include #include #include using namespace std; class Competitor : public QObject { Q_OBJECT 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: explicit Competitor(QObject *parent) : QObject(parent) {} int getCode() { return this->m_code; } QString getName() { return this->m_name; } QString getNOC() { return this->m_noc; } void setCode(int code) { this->m_code = code; } void setName(QString name) { this->m_name = name; } 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; } static bool compareNOC(const Competitor &left, const Competitor &right) { return left.m_noc.compare(right.m_noc) < 0; } signals: void nCode(); void nName(); void nNoc(); private: int m_code; QString m_name; QString m_noc; };