#ifndef GLOBALS_H #define GLOBALS_H #include #include #include class QAction; class Viewer; class QTreeView; class Globals : public QObject { Q_OBJECT public: enum ActionType { QuitAction = 0, ConfigAction = 1 }; static Globals *instance(); void addAction(QAction *a); void addView(QTreeView *v); const QVector views() { return mViews; } QAction *action(int actionType); Viewer *viewer(); private: Globals(); Globals(const Globals &other); Globals &operator=(const Globals &other); static Globals *mInstance; QHash mActions; Viewer *mViewer; QVector mViews; }; #endif // GLOBALS_H