From 41072cf48f59b67391bac637002ca4a4c224eff6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 11 Jan 2020 15:22:50 -0800 Subject: core/undo: provide access to the QUndoStack This is used by the mobile UI to get notifications when the undo text changes. Signed-off-by: Dirk Hohndel --- commands/command_base.cpp | 6 ++++++ commands/command_base.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/commands/command_base.cpp b/commands/command_base.cpp index edfc97bf3..20147a541 100644 --- a/commands/command_base.cpp +++ b/commands/command_base.cpp @@ -29,6 +29,12 @@ bool isClean() return undoStack.isClean(); } +// this can be used to get access to the signals emitted by the QUndoStack +QUndoStack *getUndoStack() +{ + return &undoStack; +} + QAction *undoAction(QObject *parent) { return undoStack.createUndoAction(parent, QCoreApplication::translate("Command", "&Undo")); diff --git a/commands/command_base.h b/commands/command_base.h index 9a2f6cf34..59c3cd412 100644 --- a/commands/command_base.h +++ b/commands/command_base.h @@ -172,6 +172,8 @@ public: // If nothing is to be done, the command will be deleted and false is returned. bool execute(Base *cmd); +QUndoStack *getUndoStack(); + } // namespace Command #endif // COMMAND_BASE_H -- cgit v1.2.3-70-g09d2