Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.9.1
-
None
Description
QShortcut does not work on macOS if the keyboard layout is Korean when the application starts
– Application started when the keyboard layout is Korean
1. Change the keyboard layout to Korean
2. Run application
3. QShortcut does not work ***
4. Change the keyboard layout to English
5. QShortcut still does not work ***
— Application started when the keyboard layout is English
1. Change the keyboard layout to English
2. Run application
3. QShortcut works
4. Change the keyboard layout to Korean
5. QShortcut works
Example:
#include <QApplication> #include <QLabel> #include <QShortcut> static int i = 0; int main(int argc, char *argv[]) { QApplication a(argc, argv); QLabel *label = new QLabel( "Click Here" ); label->setMinimumSize( 300, 200 ); label->setAlignment( Qt::AlignCenter ); QShortcut *shortcut = new QShortcut( Qt::CTRL + Qt::Key_T, label ); QObject::connect(shortcut, &QShortcut::activated, [=] { label->setText( QString( "Clicked: %1" ).arg( i++ ) ); }); label->show(); return a.exec(); }