How to use key Press Event with QlineEdit
Moved
Unsolved
Qt for Python
-
I'm trying to use Key Press event to track the key a user type in a QLineEdit but it does not seem to work. Please below is what I did. I need help please . Thanks in advance.
def keyPressEvent(self,event): #print(event.text()) self.ui.lineEdit_2.event.text()
-
Hi,
You are nuking the original behaviour with what you are doing here which is a bad idea. Also the current uncomment line is likely crashing your application.
Call the base class implementation when you do not want to explicitly change the behaviour of a function.