Hi,

Problem occurs when application have cut/copy/paste actions in menu (with shortcuts definded) and there are some widgets in the same window that need to react on that shortcuts in a different way.
Widgets are implemented in library that is shared between view projects so it have to be free of application contexts. In addition those widgets are used in plugin so cut/copy/paste can't be invoked from mainWiddow's actions (because main window don't know what's in plugins).

I need a way to catch ctrl+X/C/V shortcuts in widget and prevent them to be delivered to mainWindow's actions. I tried to add actions with different shortcut contexts to widget but it doesn't work. Then i tried to catch QEvent::ShortcutOverride in event or eventFilter and those events can be catched but even if i return true, mainwindow's action is called after widgets one and overrides clipboard contents.

I have a temporary solution - i'm processing ShortcutOverride event, by posting userEvent to the same widget, let Qt invoke mainwindows action and then do own i.e. copy action when widget gets userEvent.

I works, but i have a feeling that there have to be easier & more optimal way to achieve such behavior. Does anyone have some suggestions?