Added a ModelSummary class to make the overview over the model content accessible via QProperty system & a SummaryWidget to show this information. Only property rowCount as a proof of concept. Other properties will follow.

This commit is contained in:
2026-02-15 16:36:13 +01:00
parent b28a35280c
commit dac9ac46f2
12 changed files with 157 additions and 10 deletions

View File

@ -17,11 +17,10 @@
#include "data/settingshandler.h"
#include "model/generalsortfiltermodel.h"
#include "model/metadata.h"
#include "model/modelsummary.h"
#include "model/tablemodel.h"
#include "network/servercommunicator.h"
using namespace std;
GenericCore::GenericCore() {
qDebug() << "Creating core...";
@ -97,6 +96,8 @@ std::shared_ptr<GeneralSortFilterModel> GenericCore::getSortFilterModel() const
return m_sortFilterModel;
}
shared_ptr<ModelSummary> GenericCore::getModelSummary() const { return m_modelSummary; }
/**
* Save items to default file (in standard location).
* @brief GenericCore::saveItems Saves item fo file.
@ -163,6 +164,8 @@ void GenericCore::setupModels() {
m_mainModel = make_shared<TableModel>(m_modelUndoStack, this);
m_sortFilterModel = make_shared<GeneralSortFilterModel>(m_mainModel);
m_modelSummary = make_shared<ModelSummary>(m_mainModel, this);
/// QAbstractItemModelTester
#ifdef QT_DEBUG
m_mainModelTester = make_unique<QAbstractItemModelTester>(