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

When creating a shortcut that uses Space then the accelerator text does not appear correctly on Mac

    XMLWordPrintable

Details

    • macOS

    Description

      When creating a shortcut that uses Space then the accelerator text does not appear correctly on Mac, instead of appearing as ALT+Space, it shows as ALT+some strange character.

      Since native apps seem to show ALT+Space just fine then it should work in Qt too.

      Patch to reproduce this:

      --- a/examples/mainwindows/application/mainwindow.cpp
      +++ b/examples/mainwindows/application/mainwindow.cpp
      @@ -157,7 +157,7 @@ void MainWindow::createActions()
      
       //! [19]
           openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
      -    openAct->setShortcuts(QKeySequence::Open);
      +    openAct->setShortcut(Qt::ALT + Qt::Key_Space);
           openAct->setStatusTip(tr("Open an existing file"));
           connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
      

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes