当前位置:网站首页>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_())
边栏推荐
- Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
- Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
- 整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
- The 10th Blue Bridge Cup single chip microcomputer provincial competition
- JVM knowledge points
- 【leetcode】34. Find the first and last positions of elements in a sorted array
- 蓝桥杯单片机数码管技巧
- Object oriented thinking
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
猜你喜欢

go 包的使用

Hand tear - sort

2022-07-01: at the annual meeting of a company, everyone is going to play a game of giving bonuses. There are a total of N employees. Each employee has construction points and trouble points. They nee

Demonstration description of integrated base scheme

The fourth provincial competition of Bluebridge cup single chip microcomputer

MySQL error: expression 1 of select list is not in group by claim and contains nonaggre

Blue Bridge Cup single chip microcomputer sixth temperature recorder
![[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!](/img/46/d36ae47c3d44565d695e8ca7f34980.jpg)
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!

The 5th Blue Bridge Cup single chip microcomputer provincial competition

PIP installation of third-party libraries
随机推荐
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Installation et utilisation du lac bleu
一文彻底理解评分卡开发中——Y的确定(Vintage分析、滚动率分析等)
树莓派GPIO引脚控制红绿灯与轰鸣器
Go language introduction
Fluent icon demo
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
The first practical project of software tester: web side (video tutorial + document + use case library)
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
【leetcode】81. Search rotation sort array II
go 分支与循环
软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
Three ways for programmers to learn PHP easily and put chaos out of order
Oracle viewing locked tables and unlocking
Monkey test
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup
5G时代全面到来,浅谈移动通信的前世今生