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:
@ -14,8 +14,11 @@ class QString;
|
||||
|
||||
class TableModel;
|
||||
class GeneralSortFilterModel;
|
||||
class ModelSummary;
|
||||
class ServerCommunicator;
|
||||
|
||||
using namespace std;
|
||||
|
||||
class GenericCore : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
@ -30,8 +33,10 @@ class GenericCore : public QObject {
|
||||
void triggerApplicationUpdate(const bool saveChanges);
|
||||
|
||||
QUndoStack* getModelUndoStack() const;
|
||||
std::shared_ptr<TableModel> getModel() const;
|
||||
std::shared_ptr<GeneralSortFilterModel> getSortFilterModel() const;
|
||||
|
||||
shared_ptr<TableModel> getModel() const;
|
||||
shared_ptr<GeneralSortFilterModel> getSortFilterModel() const;
|
||||
shared_ptr<ModelSummary> getModelSummary() const;
|
||||
|
||||
void saveItems();
|
||||
void importCSVFile(const QString& filePath);
|
||||
@ -60,10 +65,11 @@ class GenericCore : public QObject {
|
||||
|
||||
private:
|
||||
QUndoStack* m_modelUndoStack;
|
||||
std::shared_ptr<TableModel> m_mainModel;
|
||||
std::shared_ptr<GeneralSortFilterModel> m_sortFilterModel;
|
||||
std::unique_ptr<QAbstractItemModelTester> m_mainModelTester;
|
||||
std::unique_ptr<QAbstractItemModelTester> m_proxyModelTester;
|
||||
shared_ptr<TableModel> m_mainModel;
|
||||
shared_ptr<GeneralSortFilterModel> m_sortFilterModel;
|
||||
shared_ptr<ModelSummary> m_modelSummary;
|
||||
unique_ptr<QAbstractItemModelTester> m_mainModelTester;
|
||||
unique_ptr<QAbstractItemModelTester> m_proxyModelTester;
|
||||
|
||||
void setupModels();
|
||||
void initModelData();
|
||||
@ -71,7 +77,7 @@ class GenericCore : public QObject {
|
||||
QString getMaintenanceToolFilePath() const;
|
||||
|
||||
/// Network communication
|
||||
std::unique_ptr<ServerCommunicator> m_serverCommunicator;
|
||||
unique_ptr<ServerCommunicator> m_serverCommunicator;
|
||||
void setupServerConfiguration();
|
||||
void applyServerConfiguration();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user