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.h | |
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.h')
-rw-r--r-- | globals.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/globals.h b/globals.h new file mode 100644 index 0000000..f659088 --- /dev/null +++ b/globals.h @@ -0,0 +1,25 @@ +#ifndef GLOBALS_H +#define GLOBALS_H + +#include <QObject> +#include <QHash> + +class QAction; + +class Globals : public QObject { + Q_OBJECT + public: + enum ActionType { QuitAction = 0, ConfigAction = 1 }; + static Globals *instance(); + void addAction(QAction *a); + QAction *action(int actionType); + + private: + Globals(); + Globals(const Globals &other); + Globals &operator=(const Globals &other); + static Globals *mInstance; + QHash<int, QAction*> mActions; +}; + +#endif // GLOBALS_H |