jqt will setAutoDefault(true) for the default button. but I am not
sure if setDefault(true) should be used instead (I'm too slow to
understand the documentation). Also the parent form in jqt is not a
QDialog, instead it is a top level QWidget without any parent, so I
don't know if default button
http://stackoverflow.com/questions/11887938/how-to-make-a-qpushbutton-pressable-for-enter-key
default in qt is supposed to make a button (intended behaviour) respond to
form_enter as well. When I add that property though, it disables the code
behind the button (it in fact erases the button
actually, with this code (default removed)
showevents_jqtide_ 1
wd 'reset'
wd 'pc a closeok escclose'
wd 'cc one button'
wd 'cc two button'
wd 'cc three button'
wd 'pshow'
pressing enter does nothing. space still executes the first button, and tab
will change which button responds to
The reason the your example works is that default is actually setting
autodefault, which just affects whether a button will respond to enter when it
has focus. Your form sets the first button as focused on show. If you press
tab, then space, other button events can be fired, but they do not
AutuDefault = true causes a button that has the focus (space key will execute
it) to also respond to enter key, even if there is a default button defined.
It is a very minor interface feature that few people use, and arguably a bad
idea (If I want to tab to a button to execute it with a key,
Qt's treatment of button default is a mystery to me.
If the first button is set to default, then pressing Enter will trigger a
JQt button event. Try:
showevents_jqtide_ 1
wd 'reset'
wd 'pc a closeok escclose'
wd 'cc one button default'
wd 'cc two button'
wd 'cc three button'
wd 'pshow'
If any