pyqt pyside QLineEdit 重写键盘事件
def keyPressEvent(self, event): if (event.modifiers() & QtCore.Qt.ShiftModifier): self.shift = True print 'Shift!' # call base class keyPressEvent QtGui.QLineEdit.keyPressEvent(self, event)
https://stackoverflow.com/questions/5047558/properly-handling-a-keypressevent-in-a-subclassed-pyqt-lineedit