diff options
author | Steru <jerrydream111@gmail.com> | 2024-08-16 22:19:42 +0200 |
---|---|---|
committer | Steru <jerrydream111@gmail.com> | 2024-08-16 23:58:46 +0200 |
commit | 88b1b119dfa35f36b64d81dbe6c84f46d86455c5 (patch) | |
tree | 864ba9c747ef86d61b6aeb01e8985676f906bd3e /src/model/EventInfo.h | |
parent | f24b4dcbd11336dabfd146c656e2437e4393b225 (diff) |
Compacted competitors into one object, deleted API class (now in sportmodel).
Diffstat (limited to 'src/model/EventInfo.h')
-rw-r--r-- | src/model/EventInfo.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/model/EventInfo.h b/src/model/EventInfo.h index 7f937b2..def3885 100644 --- a/src/model/EventInfo.h +++ b/src/model/EventInfo.h @@ -1,28 +1,27 @@ -#ifndef ITAT_CHALLANGE_OLYMPICS_EVENT_H -#define ITAT_CHALLANGE_OLYMPICS_EVENT_H +#pragma once +#include "Competitor.h" #include <QObject> +#include <QAbstractListModel> #include <qqml.h> -class EventInfo : QObject { +class EventInfo : public QObject { Q_OBJECT // QML_ELEMENT - Q_PROPERTY(QString eventName READ eventName WRITE setEventName); - Q_PROPERTY(QList<QString> competitors READ competitors WRITE setCompetitors); + Q_PROPERTY(QString eventName READ eventName CONSTANT) + Q_PROPERTY(QList<Competitor*> competitors READ competitors CONSTANT) - public: +public: explicit EventInfo(QObject *parent = nullptr); QString eventName() const; void setEventName(const QString &newEventName); - QList<QString> competitors() const; - void setCompetitors(const QList<QString> &newCompetitors); + QList<Competitor*> competitors() const; + void setCompetitors(const QList<Competitor*> &newCompetitors); - private: +private: QString m_eventName; - QList<QString> m_competitors; + QList<Competitor*> m_competitors; }; - -#endif |