@balpha is correct. The simple answer is that if you don't pass in a parent or otherwise ensure that the filter
instance has a live reference, it will be garbage collected.
PyQt uses SIP to bind to Qt's C++ implementation. From the SIP documentation:
When a C++ instance is wrapped a corresponding Python object is created. The Python object behaves as you would expect in regard to garbage collection - it is garbage collected when its reference count reaches zero. What then happens to the corresponding C++ instance? The obvious answer might be that the instance’s destructor is called. However the library API may say that when the instance is passed to a particular function, the library takes ownership of the instance, i.e. responsibility for calling the instance’s destructor is transferred from the SIP generated module to the library.
Ownership of an instance may also be associated with another instance. The implication being that the owned instance will automatically be destroyed if the owning instance is destroyed. SIP keeps track of these relationships to ensure that Python’s cyclic garbage collector can detect and break any reference cycles between the owning and owned instances. The association is implemented as the owning instance taking a reference to the owned instance.
The above implies that if you pass a Python object to a Qt object that takes ownership, everything will also work, even though you haven't guaranteed that a reference to the specific object was maintained.
So, to restate what @balpha said in his comment, here's one workaround for the case when you don't want to pass in an object to the constructor:
self.filter = delkeyFilter()
self.dataTreeView.installEventFilter(self.filter)