Answer the question
In order to leave comments, you need to log in
How to handle keyboard key presses in QLineEdit?
Hello!
Please tell me how to set the action on pressing a keyboard key in QLineEdit. There is a way to do this for the window, but I couldn’t find any information for doing it with other objects
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
import start_menu, dialog, login, registration
import mysql.connector
import random
import datetime
class Reg(QtWidgets.QDialog, registration.Ui_registration):
def __init__(self):
super().__init__()
self.setupUi(self)
def keyPressEvent(self, event):
self.timebetween.setText(str("dd")
event.accept()
..........
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question