当前位置:网站首页>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_())
边栏推荐
- Jetpack's livedata extension mediatorlivedata
- Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
- Wpviewpdf Delphi and Net PDF viewing component
- 2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
- Monkey test
- Influence of air resistance on the trajectory of table tennis
- [ibdfe] matlab simulation of frequency domain equalization based on ibdfe
- 66.qt quick-qml自定义日历组件(支持竖屏和横屏)
- 蓝桥杯单片机省赛第六届
- Sorted out an ECS summer money saving secret, this time @ old users come and take it away
猜你喜欢

The 7th Blue Bridge Cup single chip microcomputer provincial competition

《动手学深度学习》(二)-- 多层感知机

手撕——排序

Sorted out an ECS summer money saving secret, this time @ old users come and take it away

Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)

Learn more about materialapp and common attribute parsing in fluent

【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证

Qt插件之Qt Designer插件实现

Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)

Demonstration description of integrated base scheme
随机推荐
The 10th Blue Bridge Cup single chip microcomputer provincial competition
Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
The 6th Blue Bridge Cup single chip microcomputer provincial competition
The original author is out! Faker. JS has been controlled by the community..
BiShe cinema ticket purchasing system based on SSM
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
蓝桥杯单片机省赛第十一届第二场
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
Flutter中深入了解MaterialApp,常用属性解析
The confusion I encountered when learning stm32
The 5th Blue Bridge Cup single chip microcomputer provincial competition
Hands on deep learning (II) -- multi layer perceptron
[untitled]
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
Didi open source Delta: AI developers can easily train natural language models
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Installation et utilisation du lac bleu