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

KeyRelease event not propagated to parent of QLineEdit

    XMLWordPrintable

Details

    • All
    • 8afe4faf2 (dev), 9ecf68b6d (6.5), 1b5b090a5 (6.6), 92057f7f2 (tqtc/lts-6.2)

    Description

      I have attached a minimal example to this log to demonstrate the problem. The goal of the example is that the text in the label changes when pressing/releasing the alt key on your keyboard.

      This was working in Qt 5.12.6, but not anymore in Qt 6.5.0.

      The reason is following change: https://codereview.qt-project.org/c/qt/qtbase/+/311682

      In Qt5, a QLineEdit ignores the KeyRelease event and hence it was propagated to its parent (in my example the QDialog). The event was ignored because at the end of the QLineEdit::event() function, QWidget::event(e) was called and the latter function indirectly calls ignore() on the event.

      In Qt6, the KeyRelease code was moved to QLineEdit::keyReleaseEvent(), but the code which calls ignore() on the event is missing over here.

      Attachments

        For Gerrit Dashboard: QTBUG-114654
        # Subject Branch Project Status CR V

        Activity

          People

            vhilshei Volker Hilsheimer
            dbutijn David Butijn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes