Is it possible to respond to a click on a top level menu item? For example, referring to the image below, is it possible to run code when the "Help" menu item is clicked?
If so, how do I do that?
Thank you.
You can use QMenu::aboutToShow()
signal and do the following:
connect(helpMenu, SIGNAL(aboutToShow()), this, SLOT(onHelpMenuClicked()));
where helpMenu
is pointer to your Help menu and onHelpMenuClicked()
is slot that will be called as soon as you click on the Help
menu.