I’m making a GUI in PyQt5 which has a QTableWidget. Is there some way to get rid of the gray selection of the previous selected cell after moving focus from this QTableWidget to another widget in the GUI? Answer You can use the palette to control the colour of the inactive selection. Setting it to transparent would seem the best
Tag: focus
Determine the element which previously had focus?
In Java a FocusEvent has a method getOppositeComponent() which is where the focus came from or went to. In PyQt5 is there any way to find what previously had focus when overriding focusInEvent? As explained in a note, I want to be able to start an edit session automatically when the table view gets focus, end an edit session by
How to make a Tkinter window jump to the front?
How do I get a Tkinter application to jump to the front? Currently, the window appears behind all my other windows and doesn’t get focus. Is there some method I should be calling? Answer Assuming you mean your application windows when you say “my other windows”, you can use the lift() method on a Toplevel or Tk: If you want