@BigBen
When you go QMenu::addAction("SomeString") it creates a QAction for you, and returns it. And QMenu::exec() returns the QAction which was clicked. So you could check which one is returned and act on it, like:
QAction *hideAction = myMenu.addAction("Hide");
QAction *showAction = myMenu.addAction("Show");
QAction* selectedAction = myMenu.exec(globalPos);
if (selectedAction == hideAction)
qInfo() << "Hide";
else if (selectedAction == showAction)
qInfo() << "Show";
Alternatively, when you create the QActions you could attach a slot to its triggered signal:
connect(hideAction, &QAction::triggered, this, []() { qInfo() << "Hide"; } );