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

Misleading documentation for reject() and "Escape Key" in QDialog

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.0
    • Documentation
    • None
    • All

    Description

      In the QDialog documentation, one reads:

      If the user presses the Esc key in a dialog, QDialog::reject() will be called. This will cause the window to close: The close event cannot be ignored.

      Hides the modal dialog and sets the result code to Rejected.

       

      The text in the section about the escape key suggests that closeEvent() is called when pressing the Esc key. Yet, the reject() documentation says clearly that the QDialog is hidden and thus that the closeEvent() is not called.

       

      I have tested and confirm that closeEvent() is not called when the Esc key is pressed. Either this is a bug and should be fixed, or at least the documentation should be rewritten so that the user does not think that closeEvent() is called when the Esc key is pressed.

      Attachments

        Issue Links

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

          Activity

            People

              docteam Qt Documentation Team
              delaune Olivier Delaune
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes