当前位置:网站首页>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]+$")));
边栏推荐
- 软件确认测试的内容和流程有哪些?确认测试报告需要多少钱?
- Introduction to digital transformation solutions for enterprises going to sea
- Detailed explanation of conv2d of pytorch
- 基于kubernetes平台微服务的部署
- KubeVela 1.4:让应用交付更安全、上手更简单、过程更透明
- CNN classic network model details -lenet-5 (pytorch Implementation)
- latex左侧大括号 latex中大括号多行公式
- "More Ford, more China" saw through the clouds, and the orders of Changan Ford's flagship products exceeded 10000
- Deployment of microservices based on kubernetes platform
- AtCoder Beginner Contest 255
猜你喜欢

How to change the win11 computer name? Win11 method of changing computer name

Solution to the conflict between unique index and logical deletion
![[无线通信基础-13]:图解移动通信技术与应用发展-1-概述](/img/1d/62e55f1b5445d7349ec383879f4275.png)
[无线通信基础-13]:图解移动通信技术与应用发展-1-概述

10 airbags are equipped as standard, and Chery arizer 8 has no dead corner for safety protection

唯一性索引与逻辑删除冲突问题解决思路
![[Android, kotlin, tflite] mobile device integration deep learning light model tflite (object detection)](/img/7e/3e6ebfb90a82249d934296a041ba21.png)
[Android, kotlin, tflite] mobile device integration deep learning light model tflite (object detection)

理想中的接口自动化项目

MIT doctoral dissertation optimization theory and machine learning practice

Fastjson V2 simple user manual

Redis' cache penetration, cache breakdown and cache avalanche
随机推荐
AtCoder Beginner Contest 257
JMeter cross thread parameter association requires no script
Tencent has been conducting advanced automated functional testing for 3 years. It is a gift to you who are confused in manual testing
win11更新后任务栏空白怎么办? win11更新后任务栏空白卡死的解决方法
Swift5.0 ----Swift FrameWork的创建及使用
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
B_ QuRT_ User_ Guide(35)
In 2022, the latest JCR officially released the list of the latest global impact factors (top 600)
What does project management really manage?
ESP8266 成为客户端和服务器
Classic case of multithreading
Label Contrastive Coding based Graph Neural Network for Graph Classification
软件测试报告包含哪些内容?如何获取高质量软件测试报告?
Introduction to machine learning compilation course learning notes lesson 2 tensor program abstraction
What if the taskbar is blank after win11 update? Solution to blank and stuck taskbar after win11 update
Two way data binding in wechat applet
What does the &?
What are the contents and processes of software validation testing? How much does it cost to confirm the test report?
Online customer service chat system source code_ Beautiful and powerful golang kernel development_ Binary operation fool installation_ Attached construction tutorial
How to use dataant to monitor Apache APIs IX