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_())
  • 相关阅读:
    第三次作业成绩
    现代程序设计 作业6
    动态期末成绩
    课堂作业成绩公布(游戏服务器以及客户端设计)
    第二次作业(homework-02)成绩公布
    指定长度,页面显示换行
    java学习流程
    对象比对
    开发语言转型
    Asp.Net 自定义储存Session方式
  • 原文地址:https://www.cnblogs.com/leoych/p/13405312.html
Copyright © 2011-2022 走看看