>Date: Sat, 1 Nov 2008 18:46:29 +0100
> From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Subject: [PyQt] Key return
> To: "pyqt" <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hello
> i need that when i press the Return key, one button intercept the pression of
> it and process the event
> Can you explain me how i can do it
>
> Regards
>
> Luca
>
Its a little unclear what you are asking. If you do not want the original
widget to process the event then you would need to redifine the keyPressEvent()
to emit a signal with the event as an argument.
Then you connect your button widget to that event. Line Edits will already
send the event, and I"m not sure if you can sent a QEvent as a signal. I don't
know what it's appropriate c signature is offhand.
def keyPressEvent(self,event):
if event.key()==QtCore.Qt.Key_Return:
self.emit(QtCore.SIGNAL("returnPressed( QEvent )"),event)
else:
event.accept()
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt