[Qt-interest] Dialogs with buttons but no default button

Nikos Chantziaras realnc at arcor.de
Fri Feb 11 03:52:54 CET 2011


On 02/09/2011 12:32 PM, Oliver.Knoll at comit.ch wrote:
> On 2011-02-09 Nikos Nikos Chantziaras wrote:
>
>> Is it possible to create dialogs with buttons that have no default
>> button at all?
>
> Yes:
>
> http://doc.qt.nokia.com/latest/qpushbutton.html#autoDefault-prop
> http://doc.qt.nokia.com/latest/qpushbutton.html#default-prop

Unfortunately, it doesn't work as intended.  Setting setDefault(false) 
and/or setAutoDefault(false) on all buttons that are added to the dialog 
still results in one of them being rendered as having focus. 
Furthermore, pressing ENTER does nothing even after giving focus to 
another button manually (by pressing TAB.)



More information about the Qt-interest-old mailing list