Skip to main content
1 de 3
user avatar
user avatar

QLineEdit tiene la señal returnPressed que se emite cuando presionas enter.

from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import uic


class Primera(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi("Inicio.ui",self)
        self.l_codigo.returnPressed.connect(self.edit.setFocus)

        
if __name__ == '__main__':
    import sys
    app = QApplication(sys.argv)
    p = Primera()
    p.show()
    sys.exit(app.exec_())
user22539