title: How to add a list of QActions to a QMenu and handle them with a single slot?
body: <p>First, I have a list of <code>QWidget</code>s that I won't know the length of until runtime. I then create a <code>QListWidget</code> where I show them and when someone clicks them I use the signal <code>currentItemChanged(QListWidgetItem*, QListWidgetItem*)</code> to catch it and get the clicked item's index.</p>
  
  <p>Now I want to do a similar thing in the <code>QMenu</code>. I will know the list when the <code>QMenu</code> and its actions get built, but I won't be able to hard code this.</p>
  
  <p>How can I create actions, catch their signals and connect them to the same slot which does different things depending on the action's position (index) in the menu list? There must be some way to solve this since other applications use this. I tried to look at mapping but I couldn't get my head around how to use it for this.</p>
  
  <p>I tried to grab the <code>sender</code> in the slot but was not able to get any useful information from it.</p>