Is there a way to check if an event filter is installed on a Qt Widget?

392 views Asked by At

I am installing an event filter on a widget using Pyside2. This happens when a user clicks and drags on that widget. So I will install it if it's not installed yet. But after that, is there a way for me to check if this event has been installed already?

I was hoping to access some list like widget.eventFilters().

Unfortunately tracking this myself complicates the solution, that's why I am trying to query this info from Qt if possible.

1

There are 1 answers

1
Pooliey On

QT Docs for installEventFilter

If multiple event filters are installed on a single object, the filter that was installed last is activated first.

So if you somehow install the filter twice, it will only activate once, and the one activated is whatever you installed last.