appcontext.h 618 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __APPCONTEXT_H__
  2. #define __APPCONTEXT_H__
  3. #include <QObject>
  4. #include "pluginmanager.h"
  5. #include "projectmanager.h"
  6. #include "network.h"
  7. #include "serialport.h"
  8. class AppContext : public QObject
  9. {
  10. Q_OBJECT
  11. explicit AppContext(QObject *parent = nullptr);
  12. ~AppContext();
  13. public:
  14. static AppContext &instance();
  15. PluginManager &pluginManager();
  16. ProjectManager &projectManager();
  17. Network &network();
  18. SerialPort &serialPort();
  19. private:
  20. PluginManager m_pluginMgr;
  21. ProjectManager m_projectMgr;
  22. Network m_network;
  23. SerialPort m_serialPort;
  24. };
  25. #endif // APPCONTEXT_H