zoukankan      html  css  js  c++  java
  • 输入掩码

     1 """输入掩码"""
     2 
     3 import sys
     4 from PyQt5.QtWidgets import QApplication, QLineEdit, QWidget, QFormLayout
     5 
     6 class lineEditDeom(QWidget):
     7 
     8     def __init__(self):
     9         super(lineEditDeom, self).__init__()
    10         self.setWindowTitle('QLineEdit的输入掩码例子')
    11 
    12         flo = QFormLayout()
    13         pIPLineEdit = QLineEdit()
    14         pMACLineEdit = QLineEdit()
    15         pDateLineEdit = QLineEdit()
    16         pLicenseLineEdit = QLineEdit()
    17 
    18         pIPLineEdit.setInputMask("000.000.000.000;_")
    19         pMACLineEdit.setInputMask("HH:HH:HH:HH:HH:HH;_")
    20         pDateLineEdit.setInputMask("0000-00-00")
    21         pLicenseLineEdit.setInputMask(">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#")
    22 
    23         flo.addRow("数字掩码",pIPLineEdit)
    24         flo.addRow("Mac掩码",pMACLineEdit)
    25         flo.addRow("日期掩码",pDateLineEdit)
    26         flo.addRow("许可证掩码",pLicenseLineEdit)
    27 
    28         self.setLayout(flo)
    29 
    30 if __name__ == '__main__':
    31     app = QApplication(sys.argv)
    32     win = lineEditDeom()
    33     win.show()
    34     sys.exit(app.exec_())

     效果如图所示:

  • 相关阅读:
    4.7字符串
    4.5 基本类型和运算符
    4.4 变量
    4.6 字符串
    hp
    openstack newton linuxbridge 改成 ovs
    理解裸机部署过程ironic
    csredis base usage
    redisclient can not connect
    Linux Install redis
  • 原文地址:https://www.cnblogs.com/leoych/p/13413381.html
Copyright © 2011-2022 走看看