Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. namespace GameConstants{
  2. static Qt::WindowFlags windows_styles=Qt::Window|Qt::WindowMinimizeButtonHint;
  3. }
  4.  
  5. class MenuWidget:public QWidget{
  6. Q_OBJECT
  7. public:
  8. MenuWidget(const QString& window_name = "", QWidget* parent = 0);
  9. };
  10.  
  11. class GameWidget:public QWidget{
  12. Q_OBJECT
  13. public:
  14. GameWidget(const QString& window_title = GameConstants::window_title, QWidget* parent = 0);
  15. };
  16.  
  17. class Game:public QObject{
  18. Q_OBJECT
  19. private:
  20. MenuWidget* menu_widget;
  21. GameWidget* game_widget;
  22. public:
  23. Game(QObject* parent = 0);
  24. };
  25.  
  26. Game::Game(QObject *parent):QObject(parent){
  27. menu_widget = new MenuWidget(GameConstants::window_title);
  28. game_widget = new GameWidget(GameConstants::window_title);
  29.  
  30. menu_widget->setWindowFlags(GameConstants::windows_styles);
  31. game_widget->setWindowFlags(GameConstants::windows_styles);
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement