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

[REG Qt 6.5 -> 6.7] Shortcuts on macOs using Meta/Command require Shift as well

    XMLWordPrintable

Details

    • macOS

    Description

      When I connect shortcuts Qt::Meta | Qt::Key_(A-Z), only Cmd + A works as expected, Cmd + H & Q did mac's hide and quit respectively. Everything else did nothing. But if I pressed Shift + Cmd + Letter my shortcut would fire.

      Also, if I change my shortcuts to Qt::SHIFT | Qt::META | Qt::Key_(A-Z), again only A works as expected and a couple have mac default behaviors. But the rest I could not find a set of keys that would trigger my shortcut.

      To demonstrate this, I created a MainWindow that connects each Cmd + Letter key sequence to a dialog that prints the key sequence. I tested both Qt::META | Qt::Key_(Letter) and tr("Meta+Letter"). I also tested with both an apple and normal (ascii) (US) keyboard.
      I.E.
      app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta);
      QShortcut* pShortcut = new QShortcut(Qt::Meta | Qt::Key_B, pParent);
      connect(pShortcut, &QShortcut::activated, pParent, &pParent::ShowBDialog);

      This appears to have started when we switched from building with Qt 6.5.7 to Qt 6.8.0, but all my testing was done against Qt 6.8.2.

      Attachments

        For Gerrit Dashboard: QTBUG-133963
        # Subject Branch Project Status CR V

        Activity

          People

            vestbo Tor Arne Vestbø
            suzy Suzy Naegle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change