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_())
  • 相关阅读:
    android 导入项目 项目中文字乱码问题
    ListView的setOnItemClickListener不能执行
    如何让Android横竖屏切换时不销毁当前activity
    android:screenOrientation属性--限制横竖屏切换
    nwu 新生题解【第一套】
    codeforces #371div2 (ABC)
    HDU
    HDU
    树状数组
    HDU
  • 原文地址:https://www.cnblogs.com/leoych/p/13405312.html
Copyright © 2011-2022 走看看