[PyQt] default pushbutton not working as expected

Zev Goldstein zev.goldstein at gmail.com
Sun Nov 6 23:09:48 GMT 2011


I created a very basic example dialog with 2 qpushbuttons.  I set default
to true on one of them and I set autodefault to false on both of them.  I
then used pyuic4 to convert the .ui to a .py file and made a very simple
wrapper to connect simple functions to both button's click events.

The expected behavior is that pressing enter should fire the default
button's clicked handler no matter which button is currently focused, but
I'm not getting that behavior.  The default button is not getting clicked
if i have the other button selected and I press enter.

I tried building the same example in qt/c++ and I didn't have this issue.
Can anyone tell me if I'm doing something wrong.  I've attached all 3 files
I mentioned above.

-- 
-Zev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111106/249dbe8f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: untitled.ui
Type: application/x-designer
Size: 1164 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111106/249dbe8f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: untitled.py
Type: text/x-python
Size: 1559 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111106/249dbe8f/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 864 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111106/249dbe8f/attachment-0001.py>


More information about the PyQt mailing list