[PyKDE] Getting control over the Tab key

Andy Anderson afa_mma at ameritech.net
Thu Oct 24 15:50:01 BST 2002


Konrad,

Python is probably garbage-collecting the FilterObject() object. Try 
assigning it to a persistent variable, like:

   app.filter = FilterObject()
   app.installEventFilter(app.filter)

Andy Anderson

Konrad Hinsen wrote:
...
> Here is what I tried:
> 
>   class FilterObject(QObject):
> 
>       def eventFilter(self, object, event):
> 	  sys.stderr.write(repr(object) + ':' + repr(event) + '\n')
> 	  return 1
> 
>   app = QApplication(sys.argv)
>   ...
>   app.installEventFilter(FilterObject())
>   ...
>   app.exec_loop()
> 
> This doesn't crash, but doesn't do anything either, the event filter routine
> is never called.






More information about the PyQt mailing list