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

[Reg.: Qt 5.15-6.2]QLineEdit, QTextEdit and QPlainTextEdit do not get notified when Escape key is pressed on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.2.1
    • 6.2.0
    • None
    • macOS 10.15.7
    • macOS
    • 60caec953f7

    Description

      This seems as a very serious regression bug in Qt 6.2.0 on macOS. When I run the following code and when the focus is in the line edit and I press Escape key, nothing happens. No output is printed out.

      If I do the same in Qt 5.15.2, text is printed indicating that Escape key has been pressed. When I try the same with Qt 6.2.0 in Windows, it also works well.

      Note: The same problem is with QTextEdit and QPlainTextEdit. Other widgets may also be affected, though I have not tested them.

      #include <QApplication>
      #include <QLineEdit>
      #include <QDebug>
      
      class Widget : public QLineEdit
      {
      protected:
          void keyPressEvent(QKeyEvent *event) override
          {
              qDebug() << "key pressed" << event;
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          Widget w;
          w.show();
          return a.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              vladimir.kraus Vladimir Kraus
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes