KeyEvent in MainWindow (PyQt4)
问题 I'm trying to to build a GUI with PyQt4 and control some actions with the arrow keys. Nevertheless I fail to get the keystrokes. It have to be a simple issue, but I newbie to this. So any help will be appreciated. Thanks! import sys from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(910, 500) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8(