Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.7.0, 6.7.1, 6.8.0 Beta2
-
None
-
MacBook Pro M3
Sonoma 14.5 (23F79)
Description
I noticed a change in behaviour between Qt 6.6 and Qt 6.7+ when using a QMenuBar with shortcuts together with a Qt WebEngine. When the menu bar contains shortcuts with window (default) or application context, the Qt WebEngine will not properly receive shortcuts anymore. This was not the case in Qt 6.6 and earlier versions.
I added a minimal example that showcases the issue. Nevertheless here are some STR:
STR:
- Setup a QMainWindow with a QMenuBar containing actions with shortcuts that have `Qt::WindowShortcut` or `Qt::ApplicationShortcut` context.
- Create a QWebEngineView with a focus element (e.g. line edit)
- Use common shortcuts in the QWebEngine like copy, paste or select all
Expected result:
- The shortcuts work normally in the Qt WebEngine
Actual result:
- The shortcuts only work after triggering them multiple times
My current workaround is to use `Qt::WidgetShortcut` within the main QMenuBar, even though it is unexpected that the shortcuts are application global even though they are configured to use widget context.