Multiple Keyboard Shortcuts for Actions in Qt Designer

I had a strange problem with the Qt designer. I have the following shortcut to the action of renovation: F5, Ctrl+R

The idea is that on Macintosh Ctrl+ it Rdisplays in Command+ R, which is more intuitive and on Windows, it F5does the job.

The problem is that only the first shortcut seems active. Is there a way to change the action shortcut so that we have Ctrl+ Ractive on the Mac and F5everywhere? I know that I can do this in code, but I would prefer to do it in the designer.

+3
source share
1 answer

. QKeySequence QKeySequence::Refresh . - QList 2 QKeySequence , Qt:: Key enum: Qt::Key_F5 Qt::Key_Control + Qt::Key_R ( Mac OS X Command buttton, Ctrl). QActionsetShortcuts(). Max OS X F5 Command + R , F5 Ctrl + R. , Command + R F5 Mac OS X F5 Ctrl + R , , :

#ifdef Q_WS_MAC
//set Qt::Key_Control + Qt::Key_R
#else
//set Qt::Key_F5

0

Source: https://habr.com/ru/post/1715394/


All Articles