Added a QSortFilterProxyModel subclass to enable sorting by different columns in the views.
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#include "CoreConfig.h"
|
||||
#include "constants.h"
|
||||
#include "data/filehandler.h"
|
||||
#include "model/generalsortfiltermodel.h"
|
||||
#include "model/metadata.h"
|
||||
#include "model/tablemodel.h"
|
||||
|
||||
@ -89,6 +90,10 @@ QUndoStack* GenericCore::getModelUndoStack() const { return m_modelUndoStack; }
|
||||
|
||||
std::shared_ptr<TableModel> GenericCore::getModel() const { return m_mainModel; }
|
||||
|
||||
std::shared_ptr<GeneralSortFilterModel> GenericCore::getSortFilterModel() const {
|
||||
return m_sortFilterModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save items to default file (in standard location).
|
||||
* @brief GenericCore::saveItems Saves item fo file.
|
||||
@ -127,7 +132,9 @@ bool GenericCore::exportCSVFile(const QString& filePath) {
|
||||
}
|
||||
|
||||
void GenericCore::setupModels() {
|
||||
m_mainModel = make_shared<TableModel>(m_modelUndoStack, this);
|
||||
m_mainModel = make_shared<TableModel>(m_modelUndoStack, this);
|
||||
m_sortFilterModel = make_shared<GeneralSortFilterModel>(m_mainModel);
|
||||
|
||||
// TODO add QAbstractItemModelTester
|
||||
initModelData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user