Added a undo view and react to change of the cleanness of the undo stack.

This commit is contained in:
2025-12-11 16:01:48 +01:00
parent ec0d72953f
commit 902ed1c84b
2 changed files with 64 additions and 5 deletions

View File

@ -10,6 +10,8 @@ class TableModel;
QT_BEGIN_NAMESPACE
class QUndoStack;
class QUndoView;
namespace Ui {
class MainWindow;
}
@ -46,13 +48,17 @@ class MainWindow : public QMainWindow {
void openNewItemDialog();
void deleteSelectedtItems();
void onCleanStateChanged(bool clean);
void onShowUndoViewToggled(bool checked);
private:
Ui::MainWindow* ui;
// GenericCore* m_core;
unique_ptr<GenericCore> m_core;
shared_ptr<TableModel> m_tableModel;
shared_ptr<QUndoStack> m_modelUndoStack;
QUndoStack* m_modelUndoStack;
unique_ptr<QUndoView> m_modelUndoView;
/// File actions
unique_ptr<QAction> m_newFileAct;
@ -72,6 +78,8 @@ class MainWindow : public QMainWindow {
unique_ptr<QAction> m_openEditItemDialogAct;
unique_ptr<QAction> m_deleteItemAct;
unique_ptr<QAction> m_findItemAct;
/// View actions
unique_ptr<QAction> m_showModelUndoViewAct;
/// Dialogs
unique_ptr<NewItemDialog> m_newItemDialog;
@ -79,6 +87,7 @@ class MainWindow : public QMainWindow {
/// Setup functions
void createActions();
void createFileActions();
void createUndoActions();
void createEditActions();
void createHelpMenu();
void createGuiDialogs();