I want to execute my slot with a parameter when dynamically creating a QAction, but I cannot add my variables when creating a QAction in QMenu, and the default slot triggered() cannot pass it.
To be more clear, I want to archive something like this:
connect(someAction, SIGNAL( triggered(MyClass*) ), this, SLOT( execute(MyClass*) );
How can i get this? I tried to create a custom QAction, but I donβt know how to add it to QMenu - there is no function like addAction(QAction) .
source share