当前位置:网站首页>Qlineedit set input mask
Qlineedit set input mask
2022-06-11 17:18:00 【litanyuan】
background
QLineEdit It's a single line text editor , It is often used for text input in the interface .QLineEdit Provides inputMask Use some specific characters to set the format and content of the input .
inputMask
①. summary
The input mask consists of two parts :; Before that is the input format and placeholder settings ,; Then there is the blank placeholder setting .
②. Format is set
A: Only letters can be entered , And don't omit
a: Only letters can be entered , It can be omitted
N: Input only Letters and numbers , And don't omit
n: Input only Letters and numbers , It can be omitted
X: You can enter any character , And don't omit
x: You can enter any character , It can be omitted
9: You can enter numbers , And don't omit
0: You can enter numbers , It can be omitted
D: You can enter numbers 1 ~ 9, And don't omit
d: You can enter numbers 1 ~ 9, It can be omitted
#: You can enter numbers and Plus minus :+ ,-, It can be omitted
H: You can enter 16 Hexadecimal characters , And don't omit
h: You can enter 16 Hexadecimal characters , It can be omitted
B: You can enter 2 Hexadecimal characters , And don't omit
b: You can enter 2 Hexadecimal characters , It can be omitted
>: All letters are capitalized
<: All letters to lowercase
!: Stop case conversion
\: The above to special characters are displayed as normal characters
When you have to input characters before you have finished typing , Enter press signal returnPressed No response .
③. Blank placeholder setting
A blank placeholder is what the placeholder displays when no content has been entered , The default is blank , Automatically delete after user input .
Application, for example,
ui.lineEdit->setInputMask(" Find the target 99;_");// Formatting text
ui.lineEdit_2->setInputMask("000.000.000.000;_");//IP Address input
ui.lineEdit_3->setInputMask("0000-00-00;_");// Date input


边栏推荐
- Leetcode-- array
- Oracle生成不重复字符串 sys_guid()与Mysql生成唯一值
- Web security - shooting range notes
- 定制 or 订阅?未来中国 SaaS 行业发展趋势是什么?
- LeetCode-1005. Maximized array sum after K negations
- What subclasses inherit, polymorphism, and upward transformation
- Vscode automatic eslint formatting when saving code
- Derivation of child numbering formula for nodes numbered I in full k-ary tree
- JPA failed to save multiple entities circularly
- A simple understanding of closures
猜你喜欢

通过Xshell连接有跳板机/堡垒机的服务器

TypeScript学习笔记(二)

Analyze which should be tested in PMP and ACP with actual cases? Which is more useful?

ShellBrowser .NET Crack

Authing 双周动态:Authing 论坛上线(4.25-5.8)

Analysis report on sales status and supply and demand prospects of phosphoric acid fuel cell industry in the world and China 2022-2028 Edition

Docker installs mysql5.7 (enable binlog function and modify characters)

10 times faster than 5g. Are you ready for 10 Gigabit communication?

论文阅读 dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning

【clickhouse专栏】新建库、用户及角色
随机推荐
Exception handling and exception usage in golang
[opencvsharp] spot detection barcode decoding image operation image rotation / flip / Zoom perspective transformation image display control demo notes
Docker安装mysql5.7(开启binlog功能、修改字符)
What products are good for cross-border e-commerce? What are the top selling categories?
Message queue push / pull mode Learning & ActiveMQ and JMS learning
Tornado environment construction and basic framework construction -- familiar Hello World
golang中的异常处理和异常使用
《DAMA数据管理知识体系指南》:章节分值占比
Rdkit tutorial
Oracle database merge row records, wmsys WM_ Use of the concat function and group in MySQL_ Use and comparison of concat (ID).
Is the securities account given by qiniu business school safe? Do you charge for opening an account
Intranet penetration based on UDP port guessing
定制 or 订阅?未来中国 SaaS 行业发展趋势是什么?
Typescript learning notes (II)
Format eslint automatique lorsque vscode enregistre le Code
Authing 双周动态:Authing 论坛上线(4.25-5.8)
“is-a”,“has-a”,“like-a”
Meituan won the first place in fewclue in the small sample learning list! Prompt learning+ self training practice
Development planning of China's stainless steel market and suggestions on the development direction of the 14th five year plan 2022-2028
每周推荐短视频:菜鸟CEO谈未来物流新赛道