当前位置:网站首页>Qt: judge whether the string is in numeric format
Qt: judge whether the string is in numeric format
2022-06-24 11:13:00 【Xiaoying Information Technology Service Department】
Qt Development , You need to implement a basic function , Determine whether a string can be converted to a number , for example :
123.45 Can be converted into numbers ;
123.BC Can't be converted to numbers ;
Qt How to judge in ? Do some research , Found the answer :
bool isNum;
QString a = "123.56";
a.toDouble(&isNum);
qDebug() << "a isNum: " << isNum;
QString b = "123.BC";
b.toDouble(&isNum);
qDebug() << "b isNum: " << isNum;Output :

Reference resources :
边栏推荐
- How to open a video number?
- SwiftUI Swift 内功之 Swift 中的属性观察者 didSet 与 willSet
- Give you a server. Can you deploy your code online?
- 2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
- Group counting_ Structure and workflow of CPU
- SQL Server about like operator (including the problem of field data automatically filling in spaces)
- Dedecms template file explanation and homepage label replacement
- Functions of document management what functions does the document management software have
- Clickhouse deployment and basic usage 1
- 使用Process Monitor工具监测进程对注册表和文件的操作
猜你喜欢

Group counting_ Structure and workflow of CPU

Fashionable pop-up mode login registration window

Today in history: Turing's birth day; The birth of the founder of the Internet; Reddit goes online

Beauty of script │ VBS introduction interactive practice

Plant growth H5 animation JS special effect

喜歡就去行動

Cookie 、Session、localstorage、Sessionstorage的区别

@RequestBody注解

Canvas infinite scan JS special effect code

把腾讯搬到云上,治愈了他们的技术焦虑
随机推荐
Step 3: access the API interface for inquiry of SF express doc No. [express 100api interface]
Cause analysis of frequent crash and restart of easynvr-arm cloud terminal
Dedecms template file explanation and homepage label replacement
Extremenet: target detection through poles, more detailed target area | CVPR 2019
齐次坐标的理解
I want 18K. Can I pass it?
图片的可视化呈现有效增强大屏吸引力
Self cleaning Manual of mining Trojan horse
Four methods of object merging and four methods of object merging in JS
What is wireless WiFi? What are the benefits of wireless WiFi
Which is a good CAD drawing software? How to select good software
24. image mosaic operation
[activities this Saturday] NET Day in China
PHP短信通知+语音播报自动双呼
【毕业季·进击的技术er】绕树三匝,何枝可依?
Opencv optical flow prediction and remap remapping function usage
Any 与 TypeVar,让 IDE 的自动补全更好用
How to use data analysis tools to deal with emergencies in retail industry
Fais ce que tu veux.
Adobe Photoshop using the box selection tool for selection tutorial