July 7, 2011

duandcwpkt duandcwpkt
Lab Rat
2 posts

ShortCut doesn’t work on MAC OS X

 

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), SLOT));

1 reply

July 7, 2011

Jupiter Jupiter
Lab Rat
78 posts

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)

 
  ‹‹ How to use QProcess to open Safari on Mac      Copy .dll from .pro file [Solved] ››

You must log in to post a reply. Not a member yet? Register here!