Added a second bound property (nExpectedBiddings) & cleaned up the code a little.

This commit is contained in:
2026-02-16 09:24:58 +01:00
parent dac9ac46f2
commit f200fff99e
5 changed files with 70 additions and 12 deletions

View File

@ -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;
}