当前位置:网站首页>Qlineedit of QT notes (74) specifies the input type
Qlineedit of QT notes (74) specifies the input type
2022-06-30 22:55:00 【I'm classmate Huang】
One . Preface
The landlord is actually developing , The text box can only enter numbers or letters , I thought I needed to do event filtering by myself , little does one think Qt Relevant interfaces have been provided , The landlord then sorted out the records and shared them
Two . Example of setting limit input type
1. Only numbers are allowed
ui->lineEdit->setValidator(new QIntValidator(ui->lineEdit_pid));
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[0-9]+$")));
2. Only letters are allowed
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("^[A-Za-z]+$")));
3. Only letters and numbers are allowed Case insensitive
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9]+$")));
4. Only uppercase letters are allowed
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("^[A-Z]+$")));
5. Only lowercase letters are allowed
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("^[a-z]+$")));
6. Only Chinese is allowed
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[\u4e00-\u9fa5]+$")));
边栏推荐
- AtCoder Beginner Contest 255
- Femas: cloud native multi runtime microservice framework
- HP 惠普笔记本电脑 禁用触摸板 在插入鼠标后
- During telecommuting, the project team punched in the wechat group | solicited papers from the community
- Detailed explanation of conv2d of pytorch
- Solve arm_ release_ ver of this libmali is ‘g2p0-01eac0‘,rk_ so_ Ver is' 4 ', libgl1 mesa dev will not be installed, and there are unsatisfied dependencies
- In depth analysis of Apache bookkeeper series: Part 4 - back pressure
- 图纸加密如何保障我们的核心图纸安全
- What does project management really manage?
- What does the &?
猜你喜欢

电脑版微信文件存储在哪个文件夹可以找到

2022中国国潮发展新动向

深入解析 Apache BookKeeper 系列:第四篇—背压

Achieve secure data sharing among multiple parties and solve the problem of asymmetric information in Inclusive Finance

基于kubernetes平台微服务的部署

分享十万级TPS的IM即时通讯综合消息系统的架构

“飞桨+辨影相机”成为AI界的“预制菜”,工业AI质检落地更简单

MIT doctoral dissertation optimization theory and machine learning practice

公有云市场迈入深水区,冷静的亚马逊云还坐得住吗?

Redis - 01 cache: how to use read cache to improve system performance?
随机推荐
后疫情时代,云计算如何为在线教育保驾护航
Web APIs comprehensive case -tab column switching - dark horse programmer
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
Cas classique multithreadé
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
As the public cloud market enters the deep water, can the calm Amazon cloud still sit still?
[450. delete nodes in binary search tree]
【Android,Kotlin,TFLite】移动设备集成深度学习轻模型TFlite(物体检测篇)
Wechat applet transmits parameters (data-) by clicking events
d编译时计数
Braces on the left of latex braces in latex multiline formula
HP 惠普笔记本电脑 禁用触摸板 在插入鼠标后
Doker's container data volume
Introduction to digital transformation solutions for enterprises going to sea
B_ QuRT_ User_ Guide(34)
Online customer service chat system source code_ Beautiful and powerful golang kernel development_ Binary operation fool installation_ Attached construction tutorial
Zero sample and small sample learning
Go language learning notes - Gorm usage - database configuration, table addition | web framework gin (VII)
Two dots on the top of the latex letter
基于kubernetes平台微服务的部署