Python Forum
[PyQt] Avoid clicked event from button when button is not physically selected and clicked
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Avoid clicked event from button when button is not physically selected and clicked
#1
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?

Attached Files

Thumbnail(s)
   
Reply
#2
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.
Reply
#3
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter Radio button group not setting default selection simonc88 3 984 Mar-20-2025, 06:53 PM
Last Post: buran
  [Tkinter] Pixel sized button does not work associated method TheTiger 7 1,837 Dec-22-2024, 01:10 AM
Last Post: deanhystad
  Trying to update label text using a grid button. Edward_ 7 1,667 Dec-18-2024, 03:05 AM
Last Post: Edward_
  Using place for a button, many examples but AttributeError, tkinter Edward_ 3 992 Dec-17-2024, 09:06 PM
Last Post: deanhystad
  [Tkinter] button image changing but not visually updating RuaridhW 2 913 Dec-16-2024, 03:18 PM
Last Post: RuaridhW
  Button creation on Widget maiya 2 759 Dec-04-2024, 05:06 PM
Last Post: Axel_Erfurt
  Update Image on Button Click the_muffin_man 2 1,258 Nov-05-2024, 01:29 AM
Last Post: menator01
  [Tkinter] Tkinter popup no grabbing the selected keys - Event propagation Wehaveall 2 1,345 Aug-10-2024, 01:18 PM
Last Post: Wehaveall
  Button to +1 in text box everytime it's clicked martyloo 1 1,398 May-01-2024, 02:32 PM
Last Post: Axel_Erfurt
  [Tkinter] TKinter Remove Button Frame Nu2Python 8 4,753 Jan-16-2024, 06:44 PM
Last Post: rob101

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020