[PyKDE] event filters

Toby Dickenson tdickenson at devmail.geminidataloggers.co.uk
Wed Oct 15 18:42:01 BST 2003


Im not seeing event filters work how I expected. In the following script I am 
seeing the 'event' line but *never* the 'filter' line. PyQt 3.8, qt 3.1.2, on 
windows and X.

Any ideas? Thanks in advance.


from qt import *

class F(QObject):
    def eventFilter(self,ob,ev):
        print 'filter',ob,ev,'but Ive never seen this working'
        return 0
    def event(self,ev):
        print 'event',ev
        return 0

app = QApplication([])

f1 = F()
f2 = F()
f1.installEventFilter(f2)

app.sendEvent(f1,QCustomEvent(QEvent.User))

-- 
Toby Dickenson




More information about the PyQt mailing list