1

I am trying to add a shortcut to a menu item in my Qt application. I did this using this code:

ui->menuActionConnect->setShortcut(QKeySequence("Meta+D"));

When I run the application, OSX displays the meta key as the ctrl key (^ instead of ): Here you can see that the wrong character is being displayed

Is there a way to get Qt to display the character instead of the ^ character? I have tried replacing Meta with Cmd, but this did not work.

1 Answer 1

3

Use the Ctrl key to get the command key on Mac.

On Mac, Ctrl maps to the command keys and Meta maps to control keys. On Windows, Ctrl maps to the control keys and Meta maps to the windows key.

See the Qt documentation.

1
  • I knew it'd be a simple solution!
    – Nik
    Commented Aug 14, 2013 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.