Files
BeetRound/libs/BeetRoundCore/model/modelsummary.h

50 lines
1.1 KiB
C++

#ifndef MODELSUMMARY_H
#define MODELSUMMARY_H
#include <QObject>
#include <QProperty>
class TableModel;
using namespace std;
class ModelSummary : public QObject {
Q_OBJECT
Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged BINDABLE bindableRowCount)
public:
ModelSummary(shared_ptr<TableModel> model, QObject* parent = nullptr);
~ModelSummary();
int rowCount() const;
QBindable<int> bindableRowCount();
int nExpectedBiddings() const;
int nPlacedBiddings1() const;
int nPlacedBiddings2() const;
int nPlacedBiddings3() const;
int biddingSum1() const;
int biddingSum2() const;
int biddingSum3() const;
qreal biddingAverage1() const;
qreal biddingAverage2() const;
qreal biddingAverage3() const;
signals:
void rowCountChanged();
void nExpectedBiddingsChanged();
void nPlacedBiddingsChanged(const int roundNumber);
void biddingSumChanged(const int roundNumber);
void biddingAverageChanged(const int roundNumber);
private:
shared_ptr<TableModel> m_model;
Q_OBJECT_BINDABLE_PROPERTY(ModelSummary, int, m_rowCount, &ModelSummary::rowCountChanged);
};
#endif // MODELSUMMARY_H