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

Dialog with QTextEdit on Mac will not process escape key.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.3.1
    • None
    • Mac OSX 10.8
    • macOS

      I have attached a sample Qt Creator app that exhibits the problem. The app has a global event filter for keyboard. When a dialog is launched with a QTextEdit, the global event filter is not given a chance to process the escape key before the dialog is dismissed. It doesn't get the key at all. On Windows, or in a Dialog that does not have a QTextEdit, the event filter is given its chance to process the escape key.

      Debugging on the Mac shows an issue with how key events are being processed in qnsview.mm handleKeyEvent. If you put a break point in the ::reject dialog function you will see this in the call stack and that it seems to be turnign the key event into an close event without giving a chance to process it as a key event by the dialog itself, the widget, or the global event filter.

      If you run the attached application on Windows vs Mac you will see that Windows will spit out numerous statements for key pressed to the application output. On the Mac you will only get the debug statement for the reject function.

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

            vestbo Tor Arne Vestbø
            nteeuwentableau Nicolas Teeuwen
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes