Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-52591

QShortcut not work on Mac if keyboard layout switched to russian

XMLWordPrintable

    • macOS
    • 26961e32f34c06f083fe441c23be6874f03446a3

      QShortcuts in Mac OS X works very strange way with no-english keyboard layout (in windows and linux it works fine).

      1. After application start, change keyboard layout to russian - shortcuts not work.
      2. After application start, check shortcut at english keyboard layout - shortcuts work. Change layout to russian - shortcuts still work. (!!!)
      3. After application start, change keyboard layout to russian - shortcuts not work. Change layout to english - shortcuts still not work. (!!!???)
      4. If we add QAction with shortcut to application menu - shortcut work with any keyboard layout.

      Minimal example:

      #include <QApplication>
      #include <QLabel>
      #include <QShortcut>
      #include <QTime>
      
      int main(int argc, char *argv[])
      {
         QApplication a(argc, argv);
      
         QLabel* label = new QLabel(QTime::currentTime().toString("hh:mm:ss:zzz"));
         QShortcut* shortcut = new QShortcut(QKeySequence("Ctrl+U"), label);
         QObject::connect(shortcut, &QShortcut::activated, [=] {
            label->setText(QTime::currentTime().toString("hh:mm:ss:zzz"));
         });
      
         label->show();
      
         return a.exec();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            tpochep Timur Pocheptsov
            dimkanovikov Dimka Novikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes