Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ShortCut doesn't work on MAC OS X
QtWS25 Last Chance

ShortCut doesn't work on MAC OS X

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    duandcwpkt
    wrote on last edited by
    #1

    I create an action on the tool bar of main window and give it a shortcut given "Shift+F12", like the following:
    QAction* pAction = new Action("MyAction", pToolBar);
    pAction->setShortCut(QKeySequence("Shift+F12"));
    pToolBar->addAction(pAction);

    but the shortcut doesn't work. The same code DOES work on Windows. Do somebody know it?

    In addition, I use short cut in another way like the code below. It also doesn't work.
    QShortcut* pShortcut = new QShortcut(QKeySequence("Shift+F12"), this, 0, 0, Qt::ApplicationShortcut);
    connect(pShortcut, SIGNAL(activated()), SLOT(slt_ShortCut()));

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jupiter
      wrote on last edited by
      #2

      are the function keys enabled on your keyboard? on mac you can switch between the function keys and the special tasks (like f12 is making sound louder)

      alternativly you can try QKeySequence(Qt::Shift + Qt::Key_F12)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved