diff options
author | Arno <arno@disconnect.de> | 2016-09-04 17:06:53 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-09-04 17:06:53 +0200 |
commit | 51b8435880013f1d4533379811a9b89c1ea3173c (patch) | |
tree | ec5642e7b80766af184a9a839c5830ebb40659f7 /globals.cpp | |
parent | c930104f93104649ad4ae5b9e23e65a3fa2c058d (diff) | |
download | ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.tar.gz ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.tar.bz2 ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.zip |
Make QActions local to FileWidget
Introduce Globals singleton for global actions.
Diffstat (limited to 'globals.cpp')
-rw-r--r-- | globals.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/globals.cpp b/globals.cpp new file mode 100644 index 0000000..2bdb175 --- /dev/null +++ b/globals.cpp @@ -0,0 +1,22 @@ +#include <QAction> + +#include "globals.h" + +Globals *Globals::mInstance = nullptr; + +Globals *Globals::instance(){ + if(!mInstance){ + mInstance = new Globals; + } + return mInstance; +} + +void Globals::addAction(QAction *a){ + mActions.insert(a->data().toInt(), a); +} + +QAction *Globals::action(int actionType){ + return mActions.value(actionType); +} + +Globals::Globals(){} |