I have a 'search bar' popup in a PyQt5 application, which appears in response to 'Ctrl-F' like many common tools like web browsers and doc readers and such. This is a QLineEdit with a QCompleter set to show a QListView in batched mode:
When the mouse enters / is hovered over one of the completer popup entries (without requiring a mouse click), a few actions are taken: selecting (and highlighting) the corresponding entry in the application's main table view, etc. These actions are already working by fielding the built-in 'entered' signal from the completer popup. The signal is emitted every time the mouse enters a different row within the completer, which is handy:
class findPopup(QWidget,Ui_findPopup):
def __init__(self,parent):
... # defines the simple GUI including QLineEdit self.ui.findField
def showEvent(self,e):
...
self.theList= # a list of strings - omitting obscure list comprehension here
self.completer=QCompleter(self.theList)
self.completer.popup().entered.connect(self.mouseEnter)
self.ui.findField.setCompleter(self.completer)
def mouseEnter(self,i):
completerRowText=i.data()
...
So - entering the popup (and changing row) can be detected nicely - but - how can you detect the mouse exiting the completer popup area?
It doesn't look like there is any signal called self.completer.popup().exited. I'd like to take actions when the mouse leaves the completer popup: unselecting all entries in the main table view, scrolling to the bottom of the main table view, etc.
