57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
#ifndef BRRESULT_H
|
|
#define BRRESULT_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "brwidget.h"
|
|
#include "brresultdetails.h"
|
|
|
|
class BRAthlete;
|
|
class BRRound;
|
|
|
|
class BRResult : public BRWidget
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(int rank READ getRank NOTIFY metadataChanged)
|
|
Q_PROPERTY(int startNumber READ getStartNumber NOTIFY metadataChanged)
|
|
Q_PROPERTY(BRResultDetails* details READ getDetails NOTIFY metadataChanged)
|
|
Q_PROPERTY(BRAthlete* athlete READ getAthlete NOTIFY metadataChanged)
|
|
|
|
public:
|
|
friend class BRProvider;
|
|
friend class BRRound;
|
|
|
|
typedef struct {
|
|
const BRResult* result;
|
|
|
|
int rank;
|
|
int startNumber;
|
|
BRResultDetails* details;
|
|
BRAthlete* athlete;
|
|
} BRResultData;
|
|
|
|
BRWidget::BRWidgetStatusCode load() override;
|
|
|
|
Q_INVOKABLE int getRank() const;
|
|
Q_INVOKABLE int getStartNumber() const;
|
|
Q_INVOKABLE BRResultDetails* getDetails() const;
|
|
Q_INVOKABLE BRAthlete* getAthlete() const;
|
|
Q_INVOKABLE BRRound* getRound() const;
|
|
|
|
static bool lessThan(BRResult* result1, BRResult* result2);
|
|
|
|
private:
|
|
BRResult(BRResultData initialData);
|
|
void setData(BRResultData data);
|
|
|
|
int rank;
|
|
int startNumber;
|
|
BRResultDetails* details;
|
|
BRAthlete* athlete;
|
|
BRRound* round;
|
|
|
|
signals:
|
|
void metadataChanged();
|
|
};
|
|
|
|
#endif // BRRESULT_H
|