[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Getting control over the Tab key
From:       Konrad Hinsen <hinsen () cnrs-orleans ! fr>
Date:       2002-10-23 18:28:41
[Download RAW message or body]

> They may be filtered out by the widget that has focus, it's hard to

At least they never appear in keyPressEvent(), neither for the main
widget nor for the widget in focus.

> tell. If you want to make sure that you catch all the tab key events,
> have a look at QObject::eventFilter() and QObject::installEventFilter().

I tried that, but how does one define an event filter in Python?
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.

Konrad.

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic