当前位置:网站首页>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_())
边栏推荐
- 初识P4语言
- "No war on the Western Front" we just began to love life, but we had to shoot at everything
- Demonstration description of integrated base scheme
- Where can I buy cancer insurance? Which product is better?
- C语言:逻辑运算和判断选择结构例题
- Imageai installation
- Opencv learning example code 3.2.4 LUT
- The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- NLog use
猜你喜欢
树莓派GPIO引脚控制红绿灯与轰鸣器
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
蓝桥杯单片机第六届温度记录器
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
C language: examples of logical operation and judgment selection structure
How should the team choose the feature branch development mode or trunk development mode?
Jetpack之LiveData扩展MediatorLiveData
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
随机推荐
go 函数
The 7th Blue Bridge Cup single chip microcomputer provincial competition
WPViewPDF Delphi 和 .NET 的 PDF 查看组件
How should the team choose the feature branch development mode or trunk development mode?
Blue Bridge Cup single chip microcomputer sixth temperature recorder
【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
[tips] use Matlab GUI to read files in dialog mode
Go branch and loop
蓝桥杯单片机省赛第九届
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
蓝桥杯单片机省赛第七届
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
蓝桥杯单片机省赛第五届
First acquaintance with P4 language
毕设-基于SSM电影院购票系统
《动手学深度学习》(二)-- 多层感知机
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
蓝桥杯单片机第四届省赛
Learn more about materialapp and common attribute parsing in fluent
C语言:逻辑运算和判断选择结构例题