For anyone looking for the answer to this question but don’t want to scroll through over 1000 lines of code:
You need to make a separate qt.Object class:
class customEventFilter(qt.QObject):
def eventFilter(self, obj, event):
'''
Event filter for rerouting wheelEvents away from double spin boxes.
'''
if event.type() == qt.QEvent.Wheel and isinstance(obj, qt.QDoubleSpinBox):
#this handles all the wheel events for the double spin boxes
event.ignore()
return True
return False
If you’d like to ignore another type of event replace qt.QEvent.Wheel with the specific qt.Event. If you’d like to apply this filter to a different object then replace qt.QDoubleSpinBox with the specific object.
You will then need to install this filter on the specific objects you’d like to inherit the filter: