当前位置:网站首页>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
- Vite: configure IP access
- The 6th Blue Bridge Cup single chip microcomputer provincial competition
- 蓝桥杯单片机省赛第八届
- 【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
- Three ways for programmers to learn PHP easily and put chaos out of order
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- 66.qt quick-qml自定义日历组件(支持竖屏和横屏)
- Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
猜你喜欢
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
Use of go package
Document declaration and character encoding
PIP installation of third-party libraries
Delete the code you wrote? Sentenced to 10 months!
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
【小技巧】使用matlab GUI以对话框模式读取文件
Blue Bridge Cup single chip microcomputer sixth temperature recorder
Basic operations of MySQL database (based on tables)
随机推荐
Go语言介绍
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification
The 7th Blue Bridge Cup single chip microcomputer provincial competition
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Go language naming specification
C language: examples of logical operation and judgment selection structure
Raspberry pie GPIO pin controls traffic light and buzzer
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
Déchirure à la main - tri
初识P4语言
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Go language introduction
蓝桥杯单片机省赛第六届
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
Demonstration description of integrated base scheme
【leetcode】34. Find the first and last positions of elements in a sorted array
Object oriented thinking
滴滴开源DELTA:AI开发者可轻松训练自然语言模型