Confused about keypress event
Im using pyside, and I am loading a ui file from designer with QUiLoader.
def init(self, *args):
apply(QtGui.QMainWindow.init, (self,) + args)
loader = QtUiTools.QUiLoader()
file = QtCore.QFile("pyside_demo.ui")
self.ui = loader.load(file, self)
def keyPressEvent(self, e):
print "a key was pressed"
if e.key() == QtCore.Qt.Key_Escape:
print "escape was pressed"
I dont really know how to get the keypress event to work - at the moment it does not - any clues?
Perhaps you can upload your files somewhere so other people can try it on their local machine.