当前位置:网站首页>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)
边栏推荐
- antUI中a-modal 拖拽功能制作
- After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
- Audio and video knowledge
- 简单行人重识别代码到88%准确率 郑哲东 准备工作
- How to add a PDB
- antd TreeSelect获取父节点的值
- cocoapods的安装和使用
- 服务器环境配置全过程
- M-ary number STR to n-ary number
- Arc GIS basic operation 3
猜你喜欢

keepalived 实现mysql自动故障切换

JS output diamond on the console

OFDM Lecture 16 - OFDM

Qt随手笔记(三)在vs中使用QtCharts画折线图

2019 ICPC Asia Yinchuan Regional(水题题解)

arc-gis基础操作3

CSV data file settings of JMeter configuration components

Fiddler抓包工具之移动端抓包

Neural network and deep learning-6-support vector machine 1-pytorch

Personality test system V1.0
随机推荐
MySql5.7.25源码安装记录
Fiddler抓包工具之移动端抓包
面试题目大赏
添加dll
QT随手笔记(六)——更新界面、截图、文件对话框
大二上第五周学习笔记
自定义密码输入框,无圆角
Basic use of ArcGIS 4
Calling DLL to start thread
MySQL transaction
网络流学习笔记
uni-app学习总结
IIS网站配置
附加到进程之后,断点显示“当前不会命中断点 还没有为该文档加载任何符号”
matlab simulink实现模糊pid对中央空调时延温度控制系统控制
The difference between thread join and object wait
tabbarController的使用
m进制数str转n进制数
nodejs服务后台执行(forever)
The problem of the sum of leetcode three numbers