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

[Reg 6.4->6.5] QMessageBox::set(Default|Escape)Button does not work

    XMLWordPrintable

Details

    • macOS
    • c5d9e4a7a (dev), 7dc27689c (6.6), ae16c1eae (tqtc/lts-6.5)

    Description

      Calling setDefaultButton and setEscapeButton no longer has an effect on macOS (native dialogs). E.g.

              QMessageBox b;
              auto accept = b.addButton("Accept", QMessageBox::AcceptRole);
              auto reject = b.addButton("Reject", QMessageBox::RejectRole);
              b.setDefaultButton(reject);
              b.setEscapeButton(accept);
              b.exec();
              qDebug() << (b.clickedButton() == reject ? "reject button" : "accept button");
      

      prints "reject button" when pressing escape, and "accept button" when pressing enter, ignoring the set... calls.

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              con Eike Ziller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes