当前位置:网站首页>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_())
边栏推荐
- C language: examples of logical operation and judgment selection structure
- 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
- The 7th Blue Bridge Cup single chip microcomputer provincial competition
- Installation and use of blue lake
- 蓝桥杯单片机省赛第七届
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验2 蜂鸣器实验(学习笔记)
- 蓝桥杯单片机省赛第十一届
- 2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
- How about Ping An lifetime cancer insurance?
- Installation et utilisation du lac bleu
猜你喜欢

蓝桥杯单片机省赛第八届

Delete the code you wrote? Sentenced to 10 months!

蓝桥杯单片机省赛第九届

The first practical project of software tester: web side (video tutorial + document + use case library)

蓝桥杯单片机第六届温度记录器

Lost a few hairs, and finally learned - graph traversal -dfs and BFS

藍湖的安裝及使用

蓝桥杯单片机省赛第十一届第二场

潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)

【leetcode】74. Search 2D matrix
随机推荐
Flutter中深入了解MaterialApp,常用属性解析
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
Three ways for programmers to learn PHP easily and put chaos out of order
Fourier series
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
Blue Bridge Cup single chip microcomputer sixth temperature recorder
Installation et utilisation du lac bleu
蓝桥杯单片机省赛第十一届第一场
Delete the code you wrote? Sentenced to 10 months!
手撕——排序
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
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
How to model noise data? Hong Kong Baptist University's latest review paper on "label noise representation learning" comprehensively expounds the data, objective function and optimization strategy of
Feature Engineering: summary of common feature transformation methods
Didi open source Delta: AI developers can easily train natural language models
The 11th Blue Bridge Cup single chip microcomputer provincial competition
潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮