Hi everyone,
I set filter on my QMainWindow with this:
keyPressFilter = keypressfilter.KeyPressFilter(self)
self.installEventFilter(keyPressFilter)
KeyPressFilter itself:
class KeyPressFilter(QObject):
def __init__(self, parent=None):
super(KeyPressFilter, self).__init__(parent)
def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress:
print "key press %d" % event.key()
return True
else:
return QObject.eventFilter(obj, event) <- line NN
and i getting endless errors with every eventtype QEvent\QPaintEvent\QHoverEvent\etc:
line NN, in eventFilter:
TypeError: QObject.eventFilter(QObject, QEvent): argument 2 has unexpected type 'QPaintEvent'
How can i get rid of it?
Thx in advance,
Serge