pyqt5 改写函数

重新改写了keyPressEvent()

class TextEdit(QTextEdit):
    def __init__(self):
        QtWidgets.QTextEdit.__init__(self)
    def keyPressEvent(self, event):
        #继承了本身的:
        QtWidgets.QTextEdit.keyPressEvent(self,event)
#下面可以添加自己的函数了
#。。。。。。
原文地址:https://www.cnblogs.com/chulin/p/14113276.html