zoukankan      html  css  js  c++  java
  • EchoMode的显示效果

     1 import sys
     2 from PyQt5.QtWidgets import QApplication, QLineEdit, QWidget, QFormLayout
     3 
     4 class lineEditDemo(QWidget):
     5     def __init__(self):
     6         super().__init__()
     7         self.setWindowTitle('QLineEdit 例子')
     8 
     9         flo = QFormLayout()
    10         pNormalLineEdit = QLineEdit()
    11         pNoEchoLineEdit = QLineEdit()
    12         pPasswordLineEdit = QLineEdit()
    13         pPasswordEchoOnEditLineEdit = QLineEdit()
    14 
    15         flo.addRow("Normal", pNormalLineEdit)
    16         flo.addRow("NoEcho", pNoEchoLineEdit)
    17         flo.addRow("Password", pPasswordLineEdit)
    18         flo.addRow("PasswordEchoOnEdit", pPasswordEchoOnEditLineEdit)
    19 
    20         pNormalLineEdit.setPlaceholderText("Normal")
    21         pNoEchoLineEdit.setPlaceholderText("NoEcho")
    22         pPasswordLineEdit.setPlaceholderText("Password")
    23         pPasswordEchoOnEditLineEdit.setPlaceholderText("PasswordEchoOnEdit")
    24 
    25         # 设置显示效果
    26         pNormalLineEdit.setEchoMode(QLineEdit.Normal)
    27         pNoEchoLineEdit.setEchoMode(QLineEdit.NoEcho)
    28         pPasswordLineEdit.setEchoMode(QLineEdit.Password)
    29         pPasswordEchoOnEditLineEdit.setEchoMode(QLineEdit.PasswordEchoOnEdit)
    30 
    31         self.setLayout(flo)
    32 
    33 if __name__ == '__main__':
    34     app = QApplication(sys.argv)
    35     win = lineEditDemo()
    36     win.show()
    37     sys.exit(app.exec_())
  • 相关阅读:
    vue 使用echarts 柱状图使用图片显示
    Devexpress分组小计
    小写转大写
    预览打印
    LINQ
    结束任务管理器进程
    游标
    查看死锁
    sql 分页
    压缩解压缩传输的数据
  • 原文地址:https://www.cnblogs.com/leoych/p/13405312.html
Copyright © 2011-2022 走看看