On Sunday 02 November 2008 18:46:44 Matt Smith wrote: Ok, but i also have this problem.
pls. howto use press enter in button if have more button? > >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 -- Milan Hemžal 3 Trees s.r.o. -------------------------- Dřevěné podlahy a koupelny Kontakt info: GSM +420 775 393 335 www: www.3trees.cz _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
