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

Support no default button for QDialogButtonBox

    XMLWordPrintable

Details

    Description

      Currently, a QDialogButtonBox will always make the first push button with the AcceptRole the default button, even if all the buttons in the QDialogButtonBox have the default and autoDefault properties set to false. This is documented in the detailed description of QDialogButtonBox:

      "If you want a specific button to be default you need to call QPushButton::setDefault() on it yourself. However, if there is no default button set and to preserve which button is the default button across platforms when using the QPushButton::autoDefault property, the first push button with the accept role is made the default button when the QDialogButtonBox is shown."

      However, this is counter-intuitive, and chances are that if both the default and the autoDefault properties are set to false, then the application programmer really does not want a default button. Furthermore, the GNOME developer guidelines for utility windows (http://developer.gnome.org/projects/gup/hig/2.0/windows-utility.html#default-buttons) states:

      "Choose the default button to be the most likely action, such as a confirmation action or an action that applies changes in a utility window. Do not make a button the default if its action is irreversible, destructive or otherwise inconvenient to the user. If there is no appropriate button in your window, to designate as the default button, do not set one."

      A button with the AcceptRole is irreversible, as it closes the dialog.

      It would be nice if a QDialogButtonBox could have no default button when all buttons have the default and autoDefault properties set to false, even if a button has the AcceptRole.

      Attachments

        Issue Links

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

          Activity

            People

              bachewii Jens
              sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes