diff options
author | Orangerot <purple@orangerot.dev> | 2024-08-16 15:40:37 +0200 |
---|---|---|
committer | Orangerot <purple@orangerot.dev> | 2024-08-16 15:40:37 +0200 |
commit | 3d19fd72716561a0322ba0acc5c94aac9f161e9d (patch) | |
tree | ef99fce2c021d2c5f38eaa2d62be6493fa940dd1 /src/model/Sport.h | |
parent | 573403247538c50e1fb2133f73d8939532ee36fa (diff) |
feat(Sport): select Discipline
Diffstat (limited to 'src/model/Sport.h')
-rw-r--r-- | src/model/Sport.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/model/Sport.h b/src/model/Sport.h index be74a51..01798fb 100644 --- a/src/model/Sport.h +++ b/src/model/Sport.h @@ -3,6 +3,7 @@ #include <QAbstractListModel> #include <QNetworkAccessManager> +#include <qcontainerfwd.h> #include <set> #include <QJsonObject> @@ -15,6 +16,8 @@ using namespace std; class SportModel : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(QString discipline READ discipline WRITE setDiscipline); + public: enum Role { EventName = Qt::UserRole + 1, @@ -26,12 +29,17 @@ class SportModel : public QAbstractListModel { virtual int rowCount(const QModelIndex &parent) const override; virtual QVariant data(const QModelIndex &index, int role) const override; virtual QHash<int, QByteArray> roleNames() const override; + + + QString discipline() const; + void setDiscipline(const QString &discipline); public slots: - void request(); + void request(QString discipline); void parseData(); private: QList<EventInfo*> m_sportList; + QString m_discipline; QNetworkAccessManager m_networkManager; QNetworkReply *m_reply = nullptr; }; |