qlineedit显示提示框_python + pyqt5 QlineEdit QMessageBox实现信息录入和消息弹框提醒

这个博客展示了如何在Python中利用PyQt5库的QLineEdit和QMessageBox组件来实现用户信息录入,并在输入完成后弹出消息框进行确认或提示。
摘要由CSDN通过智能技术生成

#-*- coding: utf-8 -*-

#Form implementation generated from reading ui file 'first.ui'#

#Created: Wed Jul 18 14:57:14 2018#by: PyQt5 UI code generator 5.3.2#

#WARNING! All changes made in this file will be lost!

from PyQt5 importQtCore, QtGui, QtWidgetsclassUi_MainWindow(object):defsetupUi(self, MainWindow):

MainWindow.setObjectName("MainWindow")

MainWindow.resize(802, 692)

self.centralwidget=QtWidgets.QWidget(MainWindow)

self.centralwidget.setObjectName("centralwidget")

self.label_2=QtWidgets.QLabel(self.centralwidget)

self.label_2.setGeometry(QtCore.QRect(310, 150, 211, 51))

font=QtGui.QFont()

font.setFamily("Agency FB")

font.setPointSize(14)

font.setBold(True)

font.setWeight(75)

self.label_2.setFont(font)

self.label_2.setText("")

self.label_2.setObjectName("label_2")

self.label=QtWidgets.QLabel(self.centralwidget)

self.label.setGeometry(QtCore.QRect(180, 250, 101, 51))

font=QtGui.QFont()

font.setPointSize(11)

self.label.setFont(font)

self.label.setObjectName("label")

self.lineEdit_sn=QtWidgets.QLineEdit(self.centralwidget)

self.lineEdit_sn.setGeometry(QtCore.QRect(290, 260, 301, 41))

font=QtGui.QFont()

font.setPointSize(12)

self.lineEdit_sn.setFont(font)

self.lineEdit_sn.setObjectName("lineEdit_sn")

self.button_OK=QtWidgets.QPushButton(self.centralwidget)

self.button_OK.setGeometry(QtCore.QRect(280, 370, 112, 34))

self.button_OK.setObjectName("button_OK")

self.button_cancel=QtWidgets.QPushButton(self.centralwidget)

self.button_cancel.setGeometry(QtCore.QRect(470, 370, 112, 34))

self.button_cancel.setObjectName("button_cancel")

self.label_3=QtWidgets.QLabel(self.centralwidget)

self.label_3.setGeometry(QtCore.QRect(290, 50, 301, 51))

font=QtGui.QFont()

font.setPointSize(18)

font.setBold(True)

font.setWeight(75)

self.label_3.setFont(font)

self.label_3.setObjectName("label_3")

MainWindow.setCentralWidget(self.centralwidget)

self.menubar=QtWidgets.QMenuBar(MainWindow)

self.menubar.setGeometry(QtCore.QRect(0, 0,802, 30))

self.menubar.setObjectName("menubar")

MainWindow.setMenuBar(self.menubar)

self.statusbar=QtWidgets.QStatusBar(MainWindow)

self.statusbar.setObjectName("statusbar")

MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)

QtCore.QMetaObject.connectSlotsByName(MainWindow)defretranslateUi(self, MainWindow):

_translate=QtCore.QCoreApplication.translate

MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))

self.label.setText(_translate("MainWindow", "输入"))

self.button_OK.setText(_translate("MainWindow", "OK"))

self.button_cancel.setText(_translate("MainWindow", "Cancel"))

self.label_3.setText(_translate("MainWindow", "扫描输入"))

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值