app/headers/competition/brround.h

57 lines
1.2 KiB
C
Raw Permalink Normal View History

#ifndef BRROUND_H
#define BRROUND_H
#include <QObject>
#include "brwidget.h"
#include "brresult.h"
class BRCategory;
class BRRound : public BRWidget
{
Q_OBJECT
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
Q_PROPERTY(QList<QObject*> results READ getResultsQML NOTIFY resultsChanged)
public:
friend class BRProvider;
friend class BRCategory;
typedef struct {
BRRound* round;
QString name;
QList<BRResult*> results;
} BRRoundData;
BRWidget::BRWidgetStatusCode load() override;
Q_INVOKABLE BRCategory* getCategory() const;
Q_INVOKABLE bool isGeneralResult() const;
Q_INVOKABLE QString getName();
Q_INVOKABLE QList<BRResult*> getResults();
Q_INVOKABLE QList<QObject*> getResultsQML();
2020-11-04 17:25:28 +01:00
BRRoundData getData();
static bool lessThan(BRRound* round1, BRRound* round2);
private:
BRRound(BRProvider* provider, BRWidget::BRFederation federation, int id, BRRoundData initialData, bool generalResult = false);
void setData(BRRoundData data);
BRCategory* category;
bool generalResult;
QString name;
QList<BRResult*> results;
signals:
void metadataChanged();
void resultsChanged();
};
#endif // BRROUND_H