Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.1
-
None
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
- is replaced by
-
QTBUG-4021 add a method to QDialogButtonBox to disable the default button
-
- Open
-