[PyQt] Pressing enter in QLineEdit clicks QPushButton?

"V. Armando Solé" sole at esrf.fr
Tue Jun 23 13:41:20 BST 2009

Mads Ipsen wrote:
> rom the manual pages:
> "A dialog's default button is the button that's pressed when the user 
> presses Enter (Return). This button is used to signify that the user 
> accepts the dialog's settings and wants to close the dialog."
> In other words, the first button that gets added probably gets 
> connected up with this behaviour, which explains the behaviour. So 
> using a QWidget is probably the correct solution:

It is certainly not the correct solution if you really need a dialog :-)

You can also call setAutoDefault(False) for all the buttons.


More information about the PyQt mailing list