#include "modelsummary.h" #include "tablemodel.h" ModelSummary::ModelSummary(std::shared_ptr model, QObject* parent) : QObject(parent) , m_model(model) { Q_ASSERT(model); connect(m_model.get(), &TableModel::rowCountChanged, this, &ModelSummary::rowCountChanged); } ModelSummary::~ModelSummary() {} int ModelSummary::rowCount() const { const int nRows = m_model->rowCount(); return nRows; } QBindable ModelSummary::bindableRowCount() { m_rowCount = m_model->rowCount(); return &m_rowCount; }