当前位置:网站首页>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 :
边栏推荐
- The nodejs service global timeout callback failed to get process Domain problem
- Four methods of object merging and four methods of object merging in JS
- Centripetalnet: more reasonable corner matching, improved cornernet | CVPR 2020 in many aspects
- Differences among cookies, session, localstorage and sessionstorage
- Reliable remote code execution (1)
- Apple's legendary design team disbanded after jobs refused to obey cook
- Why are some old SEO methods still effective?
- Window function row in SQL Server_ number()rank()dense_ rank()
- What is a voice assistant? What will the future voice assistant look like?
- Tencent wetest platform will bring new benefits in 2021 with 618 special offers!
猜你喜欢

Use the process monitor tool to monitor process operations on registries and files

MYSQL_ Elaborate on database data types

Any 与 TypeVar,让 IDE 的自动补全更好用

"One good programmer is worth five ordinary programmers!"

历史上的今天:图灵诞生日;互联网奠基人出生;Reddit 上线

Shell脚本(.sh文件)如何执行完毕之后不自动关闭、闪退?

Apple's legendary design team disbanded after jobs refused to obey cook

腾讯开源项目「应龙」成Apache顶级项目:前身长期服务微信支付,能hold住百万亿级数据流处理...

math_ Summation and derivation of proportional series & derivation of sum and difference of equal powers / difference between two nth power numbers/

把騰訊搬到雲上,治愈了他們的技術焦慮
随机推荐
Any 与 TypeVar,让 IDE 的自动补全更好用
Multi gate mixture of experts and code implementation
What is a compressed file? What are the advantages of different methods of compressing files?
Fais ce que tu veux.
Cause analysis of frequent crash and restart of easynvr-arm cloud terminal
程序员大部分时间不是写代码,而是。。。
How does easydss use go fastdfs distributed file servers to reduce service pressure?
≥ 2012r2 configure IIS FTP
The nodejs service global timeout callback failed to get process Domain problem
Fashionable pop-up mode login registration window
如何开发短信通知和语音功能医院信息系统(HIS系统)
Introduction to the use of splice() method
System design: load balancing
喜歡就去行動
Go basic series | 4 Environment construction (Supplement) - gomod doubts
Déplacer Tencent sur le cloud a guéri leur anxiété technologique
Any and typevar make the automatic completion of IDE better
喜欢就去行动
MYSQL_精讲数据库数据类型
Why are some old SEO methods still effective?