I\'m following Mark Summerfield\'s Rapid GUI Programming with Python and Qt
which is using PyQt4. I\'d prefer to be working with PyQt5, but I have both on my ma
You are using old-style signals and slots which have not been implemented in PyQt5. Try using new-style signals and slots.
self.lineedit.returnPressed.connect(self.updateUi)
Another answer is to add keyPressEvent() method to capture keyboards events.
It will call your updateUi() method when the correct key is pressed.
def keyPressEvent(self, event):
key = event.key()
if key == Qt.Key_Enter:
#For Enter of keyboard number
print("key Enter press")
self.updateUi()
if key == Qt.Key_Return:
#For Enter of keyboard
print("key Enter press")
self.updateUi()