Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127480

Conflicting shortcuts processing between QMenuBar and QWebEngine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.7.0, 6.7.1, 6.8.0 Beta2
    • GUI: Menus, WebEngine
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            vjungbluth Victor Jungbluth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes