当前位置:网站首页>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_())
边栏推荐
- Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
- Sword finger offer II 006 Sort the sum of two numbers in the array
- Li Kou interview question 02.08 Loop detection
- Where can I buy cancer insurance? Which product is better?
- 滴滴开源DELTA:AI开发者可轻松训练自然语言模型
- Www2022 | know your way back: self training method of graph neural network under distribution and migration
- uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
- [untitled]
- 蓝桥杯单片机数码管技巧
猜你喜欢

Fluent icon demo

手撕——排序

The 6th Blue Bridge Cup single chip microcomputer provincial competition

【leetcode】34. Find the first and last positions of elements in a sorted array

文档声明与字符编码

The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition

The 5th Blue Bridge Cup single chip microcomputer provincial competition

It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years

Set vscode. When double clicking, the selected string includes the $symbol - convenient for PHP operation

Jetpack's livedata extension mediatorlivedata
随机推荐
潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)
蓝桥杯单片机第四届省赛
Where can I buy cancer insurance? Which product is better?
树莓派GPIO引脚控制红绿灯与轰鸣器
Failed to upgrade schema, error: “file does not exist
Monkey测试
Three ways for programmers to learn PHP easily and put chaos out of order
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
JVM knowledge points
Force buckle 540 A single element in an ordered array
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Didi open source Delta: AI developers can easily train natural language models
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
蓝桥杯单片机省赛第十一届第二场
Vite: configure IP access
The 9th Blue Bridge Cup single chip microcomputer provincial competition
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Wpviewpdf Delphi and Net PDF viewing component
蓝桥杯单片机省赛第十二届第一场