当前位置:网站首页>QT handy notes (II) edit control and float, qstring conversion
QT handy notes (II) edit control and float, qstring conversion
2022-07-26 09:33:00 【Flying 123_ one hundred and twenty-three】
1、Edit Control
QString qstr = ui->lineEdit->text();// Get current Edit Value on , Assign to qstr.
ui->lineEdit->setText(qstr);// Set up Edit The value on is qstr
2、QString Transfer to other types
QString qstr = “123”;// Definition qstr Value
float valFlo = qstr.toFloat();// take QString convert to float
int valInt = qstr.toInt();// take QString convert to int
double valDou = qstr.toDouble();// take QString convert to doublr
String valStr = qstr.toStdString;// take QString convert to string
3、 Other types of transfer QString
QString qstr;
float valFlo = 11.1111;
qstr = QString::asprintf("%.2f", value);//float turn QString And keep two decimal places ( Retain x Decimal place , The first is %.xf)
边栏推荐
猜你喜欢
解决npm -v突然失效 无反应
antUI中a-modal 拖拽功能制作
电机转速模糊pid控制
tabbarController的使用
After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
Basic use of ArcGIS 1
正则表达式
arcgis的基本使用4
登录模块用例编写
Your login IP is not within the login mask configured by the administrator
随机推荐
ie7设置overflow属性失效解决方法
asp. Net using redis cache (2)
“互联网+”时代的现代医学
注册模块用例编写
网站设计需要的基本知识
添加dll
OFDM 十六讲- OFDM
Use of OpenCV class
配置ADCS后访问certsrv的问题
Force deduction brush questions, sum of three numbers
TabbarController的封装
省政府召开全省高温天气安全防范工作电视电话会议
Implementation of fragment lazy loading after multi-layer nesting
高斯消元的应用
莫队学习总结(二)
VectorTileLayer更换style
吴恩达机器学习之线性回归
opencv 类的使用
Smart gourmet C language
Jmeter配置元件之CSV数据文件设置