Added a second bound property (nExpectedBiddings) & cleaned up the code a little.
This commit is contained in:
@ -7,6 +7,9 @@ ModelSummary::ModelSummary(std::shared_ptr<TableModel> model, QObject* parent)
|
||||
, m_model(model) {
|
||||
Q_ASSERT(model);
|
||||
connect(m_model.get(), &TableModel::rowCountChanged, this, &ModelSummary::rowCountChanged);
|
||||
// TODO ? use existing model signals (dataChanged(role),...) instead of special signals
|
||||
connect(m_model.get(), &TableModel::nExpectedBiddingsChanged, this,
|
||||
&ModelSummary::nExpectedBiddingsChanged);
|
||||
}
|
||||
|
||||
ModelSummary::~ModelSummary() {}
|
||||
@ -20,3 +23,10 @@ QBindable<int> ModelSummary::bindableRowCount() {
|
||||
m_rowCount = m_model->rowCount();
|
||||
return &m_rowCount;
|
||||
}
|
||||
|
||||
int ModelSummary::nExpectedBiddings() const { return m_model->nExpectedBiddings(); }
|
||||
|
||||
QBindable<int> ModelSummary::bindableNExpectedBiddings() {
|
||||
m_nExpectedBiddings = m_model->nExpectedBiddings();
|
||||
return &m_nExpectedBiddings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user