How to add a list of QActions to a QMenu and handle them with a single slot?
First, I have a list of QWidget s that I won't know the length of until runtime. I then create a QListWidget where I show them and when someone clicks them I use the signal currentItemChanged(QListWidgetItem*, QListWidgetItem*) to catch it and get the clicked item's index. Now I want to do a similar thing in the QMenu . I will know the list when the QMenu and its actions get built, but I won't be able to hard code this. 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