在PyQt5中QLineEdit里面的内容回车发送的方法是和PyQt4中不同的,主要是信号槽的写法的改变导致的。
具体不同如下:
在PyQt4中,我们要进行回车发送的时候,一般这么写:
self.connect(self.lineEdit, SIGNAL("returnPressed()"), self.lineEdit_function)
但是在PyQt5中,写法有所改变,一般这么写:
self.lineEdit.returnPressed.connect(self.lineEdit_function)