# -*- coding:utf-8 -*-
'''
Created on Sep 20, 2018 @author: SaShuangYiBing Comment:
'''
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QLabel,QLineEdit class New_test(QWidget):
def __init__(self):
super().__init__()
self.initUI() def initUI(self):
self.lbl = QLabel(self)
qle = QLineEdit(self)
qle.move(60,100)
self.lbl.move(60,40) qle.textChanged.connect(self.onChange) self.setGeometry(300,300,280,170)
self.setWindowTitle('QLineEdit')
self.show() def onChange(self,text):
self.lbl.setText(text)
self.lbl.adjustSize() if __name__ == '__main__':
app = QApplication(sys.argv)
ex = New_test()
sys.exit(app.exec_())

PyQt5--QLineEdit-LMLPHP

05-11 13:52