[PyQt] Keypressevent

lucaberto at libero.it lucaberto at libero.it
Wed Sep 8 10:06:59 BST 2010


hello i need to intercept the return and the enter key in a plaintextedit and i 
have write this 
def keyPressEvent(self, event):
        self.plainTextEdit.keyPressEvent(event)
        if event.key()  == QtCore.Qt.Key_Return :
            print  ' return'
        elif event.key() == QtCore.Qt.Key_Enter :   
            print ' enter'

but the def keyPressEvent is called only if i press for ex blocnum and not 
when i push normal letter or return or enter.
Can you explain me how to do it

Thanks

Luca


More information about the PyQt mailing list