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

Can't prevent close when overridding QDialog reject on Qt 5.0 / macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15
    • 5.0.0
    • None
    • macOS
    • macOS

    Description

      I have a QWizard-based dialog which guides the user through a firmware update. While the update is being installed, I want to prevent the dialog from being closed.

      As suggested by the documentation, this can be accomplished by overrriding reject(). If the current page is the install page, reject is trapped, preventing the wizard from being closed.

      void FirmwareUpdateWizard::reject()
      {
      if (currentId() == InstallPageId)

      { return; }

      QWizard::reject();
      }

      The above code works fine on Windows using Qt 5.0. However, on macOS using Qt 5.0, the wizard window is always hidden after the reject call, regardless of whether or not it was trapped. It should be noted that when compiling against Qt 4.x, this bug does not exist and the window is not closed on macOS (as desired).

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            jaredhanson Jared Hanson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes