I have an app that has Ctrl+S as a shortcut for the Save action in the file menu. This action has the default shortcut context of Qt::WindowShortcut.
In this app there's a docking window with an action that also uses the shortcut Ctrl+S. This shortcut has the context Qt::WidgetShortcut.
The window shortcut works fine. (It is executed if Ctrl+S is pressed when the focus is anywhere except the docking window I mentioned.)
The widget shortcut doesn't really work. That is, if the window action is disabled, then the widget one works, since there's no ambiguity. But if both actions are enabled, and the focus is on the docking window, then Ctrl+S does nothing.
It would seem to me that it wouldn't be unreasonable to expect that in the case of identical active shortcuts, then if one has more "local" context than the other, it would be the one to execute. I don't suppose there's any way to tell the Qt framework that that's what I want to happen? Or a general way to work around this? I could simply change one of the shortcuts so they aren't ambiguous, but these are localizable and platform-dependent so I can't guarantee that no other similar situation will arise.