Adding new items to the model can now be made undone/redone.
This commit is contained in:
@ -19,7 +19,8 @@ using namespace std;
|
||||
GenericCore::GenericCore() {
|
||||
qDebug() << "Creating core...";
|
||||
|
||||
m_modelUndoStack = make_shared<QUndoStack>(this);
|
||||
// TODO let the model own its undo stack (& use TableModel::getUndoStack() if necessary)
|
||||
m_modelUndoStack = new QUndoStack(this);
|
||||
|
||||
setupModels();
|
||||
}
|
||||
@ -74,12 +75,12 @@ void GenericCore::triggerApplicationUpdate() {
|
||||
QProcess::startDetached(toolFilePath, args);
|
||||
}
|
||||
|
||||
std::shared_ptr<QUndoStack> GenericCore::getModUndoStack() const { return m_modelUndoStack; }
|
||||
QUndoStack* GenericCore::getModelUndoStack() const { return m_modelUndoStack; }
|
||||
|
||||
std::shared_ptr<TableModel> GenericCore::getModel() const { return m_mainModel; }
|
||||
|
||||
void GenericCore::setupModels() {
|
||||
m_mainModel = make_shared<TableModel>(this);
|
||||
m_mainModel = make_shared<TableModel>(m_modelUndoStack, this);
|
||||
// TODO add QAbstractItemModelTester
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user