pyqt 实现QlineEdit 输入密码显示成圆点的方法
作者:这、一年 时间:2022-04-16 05:15:55
使用自带的函数就可以实现:
lineEdit.setEchoMode(QLineEdit.Password)
import struct
from PyQt5.QtWidgets import (QMessageBox, QLineEdit)
from PyQt5.QtGui import QPixmap
{...}
class LoginWindow(QtWidgets.QWidget):
{...}
def __init__(self):
super(LoginWindow, self).__init__()
# 加载ui文件
loadUi('login.ui', self)
# 设置背景图片
background = QPixmap("img/login_background.jpeg")
background = background.scaled(self.background_label.width(),self.background_label.width())
self.background_label.setPixmap(background)
# 设置输入密码框
self.passwd_lineEdit.setEchoMode(QLineEdit.Password)
{.......}
def mainpage():
app = QtWidgets.QApplication(sys.argv)
login_window = LoginWindow()
login_window.show()
sys.exit(app.exec_())
来源:https://blog.csdn.net/qq_29666899/article/details/79127129
标签:pyqt,QlineEdit,密码,圆点
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
asp中Access与Sql Server数据库区别总结
2007-11-18 15:08:00
python本地文件服务器实例教程
2022-07-31 16:38:17
![](https://img.aspxhome.com/file/2023/7/64607_0s.jpg)
python使用tqdm模块处理文件阅读进度条显示
2022-09-08 11:29:17
![](https://img.aspxhome.com/file/2023/3/76793_0s.jpg)
Python专用方法与迭代机制实例分析
2021-09-07 22:05:22
Python基于React-Dropzone实现上传组件的示例代码
2021-04-01 19:53:03
详解Python的循环结构知识点
2021-09-30 11:42:03
Python操作lxml库实战之Xpath篇
2023-12-26 23:08:00
![](https://img.aspxhome.com/file/2023/2/118622_0s.png)
Mootools常用方法扩展(三)
2009-01-14 20:07:00
关于PyQt5主窗口图标显示问题汇总
2022-03-27 08:23:18
![](https://img.aspxhome.com/file/2023/9/85029_0s.png)
仅允许指定的机器连接SQL Server服务器
2010-07-22 19:54:00
python tkinter实现简单计算器功能
2022-06-16 22:34:09
![](https://img.aspxhome.com/file/2023/7/108047_0s.jpg)
Python中摘要算法MD5,SHA1简介及应用实例代码
2023-12-12 00:36:41
Pandas.DataFrame转置的实现 <font color=red>原创</font>
2022-03-02 03:07:34
网站改版常见问题答疑
2008-08-22 18:31:00
Python 并行化执行详细解析
2021-09-23 22:20:52
![](https://img.aspxhome.com/file/2023/0/70680_0s.png)
利用tkinter改变下拉列表(Combobox)的选项值
2023-07-20 03:10:37
Tab(选项卡)的产品设计原则及应用[译]
2009-07-09 19:05:00
![](https://img.aspxhome.com/file/UploadPic/20097/9/01-24s.gif)
老生常谈Python之装饰器、迭代器和生成器
2023-04-08 08:28:19
Python 深入了解opencv图像分割算法
2021-11-30 09:42:00
![](https://img.aspxhome.com/file/2023/7/65087_0s.jpg)
Anaconda修改默认虚拟环境安装位置的方案分享
2022-11-19 22:36:52
![](https://img.aspxhome.com/file/2023/9/103239_0s.png)