Python Forum
[PyQt] Avoid clicked event from button when button is not physically selected and clicked - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [PyQt] Avoid clicked event from button when button is not physically selected and clicked (/thread-26063.html)



Avoid clicked event from button when button is not physically selected and clicked - mart79 - Apr-20-2020

I have a GUI with several buttons, line-edits and combo-boxes.
When I load this GUI and select a line-edit or combo-box to change input, it triggers the 'add' button on hitting enter.
This seems to be caused by the 'add' button being active somehow (blue outline around the button).

How can I remove this trigger when hitting enter in a line-edit or any edit field?


RE: Avoid clicked event from button when button is not physically selected and clicked - deanhystad - Apr-20-2020

This is not normal behavior. When clicking on a line edit or combo box widget the selected widget should take focus from the add button (no blue box around Add). I have no way of knowing why this is not working without seeing the code.


RE: Avoid clicked event from button when button is not physically selected and clicked - mart79 - May-05-2020

(Apr-20-2020, 01:21 PM)deanhystad Wrote: This is not normal behavior. When clicking on a line edit or combo box widget the selected widget should take focus from the add button (no blue box around Add). I have no way of knowing why this is not working without seeing the code.

Ok, unfortunately I can't disclose the code. I made a workaround by setting each button to receive no focus at all.
This for now avoids the problem.