I want to have a variable amount of INTs in a menu, and if the user clicks on one of the items, the QAction triggers() and i process the integer that belongs to the menu item.

The problem is that the number of INTs to be displayed in the menu varies, and that i actually always call the same function for processing the INT number. A static amount of QActions and a slot for each actions is therefore inefficient.

It's not a perfect solution, but the window owning the menu could keep a vector of actions. If the context menu event fires, the vector is emptied and refilled with the desired amount of QActions.
This would manage the lifetime of the QActions but does not address the core problem: connecting to the triggered() event of an QAction, there is no way of knowing WHICH Action was fired, and thus which number to process.

Is there any good way to work around this?