当前位置:网站首页>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_())
边栏推荐
- 蓝桥杯单片机省赛第九届
- 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
- JVM知识点
- BiShe cinema ticket purchasing system based on SSM
- 【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
- How should the team choose the feature branch development mode or trunk development mode?
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- 0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
- First acquaintance with string+ simple usage (II)
- 整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
猜你喜欢

Jetpack's livedata extension mediatorlivedata

Jetpack之LiveData扩展MediatorLiveData

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

The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup

跳出舒适区,5年点工转型自动化测试工程师,我只用了3个月时间

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

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

0基础如何学习自动化测试?按照这7步一步一步来学习就成功了

滴滴开源DELTA:AI开发者可轻松训练自然语言模型

The 8th Blue Bridge Cup single chip microcomputer provincial competition
随机推荐
近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
How about Ping An lifetime cancer insurance?
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
Where can I buy cancer insurance? Which product is better?
手撕——排序
接口调试工具模拟Post上传文件——ApiPost
Document declaration and character encoding
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
[untitled]
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
go 语言命名规范
Didi open source Delta: AI developers can easily train natural language models
The 9th Blue Bridge Cup single chip microcomputer provincial competition
Jetpack之LiveData扩展MediatorLiveData
潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)
pip 安装第三方库
5g era is coming in an all-round way, talking about the past and present life of mobile communication
Flutter中深入了解MaterialApp,常用属性解析
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