Guest User

Untitled

a guest
Mar 11th, 2012
143
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ApplicationWindow.h"
  2.  
  3. ApplicationWindow::ApplicationWindow()
  4. {
  5.     resize(800, 600);
  6.  
  7.     stack = new QStackedWidget(this);
  8.     signalMapper = new QSignalMapper(this);
  9.  
  10.     mainMenu = new MainMenu(this);
  11.     loadGameMenu = new LoadGameMenu(this);
  12.  
  13.     stack->addWidget(mainMenu);
  14.     stack->addWidget(loadGameMenu);
  15.  
  16.     connect(mainMenu, SIGNAL(loadGameClicked()), signalMapper, SLOT(map()));
  17.     connect(loadGameMenu, SIGNAL(backToMainMenuClicked()), signalMapper, SLOT(map()));
  18.  
  19.     signalMapper->setMapping(mainMenu, 1);
  20.     signalMapper->setMapping(loadGameMenu, 0);
  21.  
  22.     connect(signalMapper, SIGNAL(mapped(int)), stack, SLOT(setCurrentIndex(int)));
  23.  
  24.     setCentralWidget(stack);
  25. }
RAW Paste Data