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

Minus button doesn't work correctly in firefox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • None
    • 5.12.0, 5.12.1
    • None
    • Qt 5.12.1, Emscripten 1.38.21 and Firefox 65.0
    • WebAssembly

      QKeyEvent sends wrong key code for '-' and '_' in Firefox when in Chromium code is correct.

      #include <QApplication>
      #include <QWidget>
      #include <QLabel>
      #include <QKeyEvent>
      #include <QString>
      #include <QObject>
      
      class Filter: public QObject
      {
      public:
          Filter(QObject *parent=nullptr): QObject(parent)
          {
          }
      protected:
          bool eventFilter(QObject *, QEvent *ev) override
          {
              if(ev->type()==QEvent::KeyPress)
              {
                  QKeyEvent *kEv=static_cast<QKeyEvent*>(ev);
                  l.setText(QString("You pressed key %1.\nQt::Key_Minus=%2").arg(kEv->key()).arg(Qt::Key_Minus));
                  l.show();
      
              }
              return false;
          }
      private:
          QLabel l;
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QWidget w;
          w.installEventFilter(new Filter(&w));
          w.show();
          return a.exec();
      }
      

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

            lpotter Lorn Potter
            andrey_yashkin Andrey Yashkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes