当前位置:网站首页>Use a mask to restrict the input of the qlineedit control
Use a mask to restrict the input of the qlineedit control
2022-07-02 04:01:00 【bus_ lupe】

from PyQt5.QtWidgets import *
import sys
class QLineEditMask(QWidget):
def __init__(self):
super(QLineEditMask, self).__init__()
self.initUI()
def initUI(self):
self.setWindowTitle(' Use a mask to limit QLineEdit Control input ')
ipLineEdit = QLineEdit()
macLineEdirt = QLineEdit()
dateLineEdit = QLineEdit()
licenseLineEdit = QLineEdit()
ipLineEdit.setInputMask("000:.000:000:000;_")
macLineEdirt.setInputMask("HH:HH:HH:HH:HH:HH;_")
dateLineEdit.setInputMask("0000-00-00")
licenseLineEdit.setInputMask('>AAAA-AAAA-AAAA-AAAA-AAAA;#')
formLayout = QFormLayout()
formLayout.addRow(' Digital mask ', ipLineEdit)
formLayout.addRow('Mac Mask ', macLineEdirt)
formLayout.addRow(' Date mask ', dateLineEdit)
formLayout.addRow(' License mask ', licenseLineEdit)
self.setLayout(formLayout)
if __name__ == '__main__':
app = QApplication(sys.argv)
mainWindow = QLineEditMask()
mainWindow.show()
sys.exit(app.exec_())
边栏推荐
- LxC limits the number of CPUs
- 毕设-基于SSM电影院购票系统
- 蓝桥杯单片机省赛第七届
- Go function
- How about Ping An lifetime cancer insurance?
- Learn more about materialapp and common attribute parsing in fluent
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- Hand tear - sort
- 【小技巧】使用matlab GUI以对话框模式读取文件
- Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
猜你喜欢

蓝桥杯单片机省赛第九届

手撕——排序

蓝桥杯单片机省赛第六届

Sword finger offer II 006 Sort the sum of two numbers in the array

Interface debugging tool simulates post upload file - apipost

近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下

《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮

u本位合约爆仓清算解决方案建议

Didi open source Delta: AI developers can easily train natural language models

The 8th Blue Bridge Cup single chip microcomputer provincial competition
随机推荐
go 语言命名规范
Go function
跳出舒适区,5年点工转型自动化测试工程师,我只用了3个月时间
Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface
蓝桥杯单片机数码管技巧
5g era is coming in an all-round way, talking about the past and present life of mobile communication
XSS prevention
Imageai installation
Use of go package
Opencv learning example code 3.2.4 LUT
Realizing deep learning framework from zero -- Introduction to neural network
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
The 5th Blue Bridge Cup single chip microcomputer provincial competition
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
VS2010 plug-in nuget
The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
Fingertips life Chapter 4 modules and packages
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)