View Single Post
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#3
http://doc.qt.nokia.com/4.7/qwidget....eyReleaseEvent

http://doc.qt.nokia.com/4.7/qkeyevent.html

Have you tried overriding the keyReleaseEvent virtual function? The following works for me in Python:

Code:
class MainWindow(QMainWindow):
  ...
  def keyReleaseEvent(self,event)
    if event.nativeScanCode() == 36:
      print 'I hit the Return key!'
  ...
As long as the keyboard focus is right, something like the following should work too:

Code:
class MyLineEdit(QLineEdit):
  ...
  def keyReleaseEvent(self,event)
    if event.nativeScanCode() == 36:
      print 'I hit the Return key!'
  ...
__________________
N9: Go white or go home

Last edited by daperl; 2011-06-18 at 14:57.
 

The Following User Says Thank You to daperl For This Useful Post: