42 lines
1.1 KiB
C++
42 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)
|
|
Q_PROPERTY(int nExpectedBiddings READ nExpectedBiddings NOTIFY nExpectedBiddingsChanged BINDABLE
|
|
bindableNExpectedBiddings)
|
|
|
|
public:
|
|
ModelSummary(shared_ptr<TableModel> model, QObject* parent = nullptr);
|
|
~ModelSummary();
|
|
|
|
int rowCount() const;
|
|
QBindable<int> bindableRowCount();
|
|
int nExpectedBiddings() const;
|
|
QBindable<int> bindableNExpectedBiddings();
|
|
|
|
signals:
|
|
void rowCountChanged();
|
|
|
|
void nExpectedBiddingsChanged();
|
|
private:
|
|
shared_ptr<TableModel> m_model;
|
|
|
|
Q_OBJECT_BINDABLE_PROPERTY(ModelSummary, int, m_rowCount, &ModelSummary::rowCountChanged);
|
|
Q_OBJECT_BINDABLE_PROPERTY(ModelSummary,
|
|
int,
|
|
m_nExpectedBiddings,
|
|
&ModelSummary::nExpectedBiddingsChanged);
|
|
};
|
|
|
|
#endif // MODELSUMMARY_H
|