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_())
  • 相关阅读:
    [转]子网掩码与子网划分
    子网划分的两个例子
    浅谈算法和数据结构系列汇总(转)
    拓扑排序和关键路径
    生成树及最小生成树
    图的遍历
    单选按钮的显示与隐藏列项
    CSS3实现鼠标移动到图片上图片变大
    优酷的视频地址获取接口
    提交按钮ajax方式
  • 原文地址:https://www.cnblogs.com/leoych/p/13405312.html
Copyright © 2011-2022 走看看