Is it possible to call a unique function when someone holds ctrl and clicks on a menu entry (e.g. File → Open)?
Is it possible to call a unique function when someone holds ctrl and clicks on a menu entry (e.g. File → Open)?
Surely. IMO, you need to derive from QAction, define your "ctrl-clicked" signal, reimplement event() and check with ctrl click in it. At the end of the handler, call the base handler. Now create a menu item using your QAction. The menu item should react on ctrl clicks. IMO, in the Designer, it should be possible to promote the menu item to your QAction so that the integration is complete. (I've never done such things, all this are only thoughts.)
ravas (26th June 2015)
Thank you.![]()
Bookmarks