pyqt pyside QLineEdit 重寫鍵盤事件

pyqt pyside QLineEdit 重寫鍵盤事件




https://stackoverflow.com/questions/5047558/properly-handling-a-keypressevent-in-a-subclassed-pyqt-lineeditdef keyPressEvent(self, event): if (event.modifiers() & QtCore.Qt.ShiftModifier): self.shift = True print 'Shift!' # call base class keyPressEvent QtGui.QLineEdit.keyPressEvent(self, event)
相關文章
相關標籤/搜索