title: How to connect the same Widget to multiple QSignalMapper mappings
body: <p>Following on from <a href="https://stackoverflow.com/questions/9651976/transitioning-between-menu-screens-with-qstatemachine/">this question</a>, I have a menu system as follows:</p>
  
  <pre><code>MainMenu &gt; (Load Game button clicked) &gt; LoadGameMenu
  LoadGameMenu &gt; (Back To Main Menu button clicked) &gt; MainMenu
  LoadGameMenu &gt; (Load button clicked) &gt; GameScreen
  </code></pre>
  
  <p>However, when I click on the Load button, the MainMenu is shown instead. Here's my code:</p>
  
  <pre><code>ApplicationWindow::ApplicationWindow()
  {
      resize(800, 600);
  
      stack = new QStackedWidget(this);
      signalMapper = new QSignalMapper(this);
  
      mainMenu = new MainMenu(this);
      loadGameMenu = new LoadGameMenu(this);
      gameScreen = new GameScreen(this);
  
      stack-&gt;addWidget(mainMenu);
      stack-&gt;addWidget(loadGameMenu);
      stack-&gt;addWidget(gameScreen);
  
      connect(mainMenu, SIGNAL(loadGameClicked()), signalMapper, SLOT(map()));
      connect(loadGameMenu, SIGNAL(backToMainMenuClicked()), signalMapper, SLOT(map()));
      connect(loadGameMenu, SIGNAL(loadClicked()), signalMapper, SLOT(map()));
  
      signalMapper-&gt;setMapping(loadGameMenu, 0);
      signalMapper-&gt;setMapping(mainMenu, 1);
      signalMapper-&gt;setMapping(gameScreen, 2);
  
      connect(signalMapper, SIGNAL(mapped(int)), stack, SLOT(setCurrentIndex(int)));
  
      setCentralWidget(stack);
  }
  </code></pre>
  
  <p>I know I'm doing something wrong with the signal mapping, but I don't know what it is.</p>
  
  <p>Cheers.</p>