guiscenemanager.h 890 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef INCLUDEGUIGUISCENEMANAGER_H
  2. #define INCLUDEGUIGUISCENEMANAGER_H
  3. #include <QObject>
  4. #include <QMainWindow>
  5. #include <QGridLayout>
  6. #include <map>
  7. class Scene;
  8. class GuiSceneManager : public QObject
  9. {
  10. Q_OBJECT
  11. private:
  12. explicit GuiSceneManager(QObject *parent = nullptr);
  13. ~GuiSceneManager();
  14. public:
  15. static GuiSceneManager& getInstance() {
  16. static GuiSceneManager instance;
  17. return instance;
  18. }
  19. public slots:
  20. bool registerScene(QString scene_name, Scene* name);
  21. bool changeScene(QString scene_name, QString args = "");
  22. Scene *getScene(QString scene_name);
  23. bool show(QString scene_name);
  24. bool hide(QString scene_name);
  25. private:
  26. std::map<QString, Scene*> scenes_;
  27. QString current_scene_;
  28. QMainWindow* window_;
  29. QGridLayout* window_layout_;
  30. signals:
  31. public slots:
  32. };
  33. #endif // INCLUDEGUIGUISCENEMANAGER_H