Hello there,
I'm working with PyQt and trying to filter an event, but it doesn't seem to work. I wrote a simple test (which seems correct to me), but doesn't work too.

Here the code:
Qt Code:
  1. #!/usr/bin/python
  2.  
  3. import sys
  4. from PyQt4.QtGui import *
  5. from PyQt4.QtCore import *
  6.  
  7. class SomeFilter(QObject):
  8. def eventFilter(self, obj, ev):
  9. print("Event filtering ok")
  10. return False
  11.  
  12. class MainWidget(QMainWindow):
  13. def __init__(self):
  14. QMainWindow.__init__(self)
  15. self.installEventFilter(SomeFilter())
  16.  
  17. app = QApplication(sys.argv)
  18. w = MainWidget()
  19. w.show()
  20. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode 

The print is never executed (on loading, resizing, repainting and closing)

Am I doing this wrong?
Thanks