diff options
| author | Steru <jerrydream111@gmail.com> | 2024-08-15 19:21:02 +0200 | 
|---|---|---|
| committer | Steru <jerrydream111@gmail.com> | 2024-08-16 23:50:34 +0200 | 
| commit | 70d5f014e50b9255dcb5c36122a109cc049c8936 (patch) | |
| tree | f14ab291bec1a27457166ab1c4e0e70920b2ffa9 /src/model/Competitor.h | |
| parent | 173ce00cf29822294137d3ebacc5b33ad01a3d25 (diff) | |
Added Q Object macros.
Diffstat (limited to 'src/model/Competitor.h')
| -rw-r--r-- | src/model/Competitor.h | 17 | 
1 files changed, 15 insertions, 2 deletions
diff --git a/src/model/Competitor.h b/src/model/Competitor.h index 919c2fa..1121a5b 100644 --- a/src/model/Competitor.h +++ b/src/model/Competitor.h @@ -5,13 +5,26 @@  #include <QString>  #include <QMap>  #include <QJsonObject> +#include <QAbstractListModel>  #include <stdexcept>  using namespace std;  class Competitor { +    Q_OBJECT + +    Q_PROPERTY(int code READ code) +    Q_PROPERTY(QString name READ name) +    Q_PROPERTY(QString noc READ noc) +  public: +    Competitor() { +        this->code = 0; +        this->name = "na"; +        this->noc = "---"; +    } +      Competitor(const Competitor &competitor) {          this->code = competitor.code;          this->name = competitor.name; @@ -22,14 +35,14 @@ public:          setCompetitor(competitor);      } -    QString getCode() { return this->code; } +    int getCode() { return this->code; }      QString getName() { return this->name; }      QString getNOC() { return this->noc; }      bool setCompetitor(const QJsonObject &competitor);  private: -    QString code; +    int code;      QString name;      QString noc;  | 
