QString
//QString定义
QString s1 = "abc";
QString s2("hello");
//字符串连接
QString s = s1 + s2;
//组包
s = QString("a = %1, b = %2, c = %3").arg(250).arg("hello").arg(22.22);
qDebug()<<s;
//输出结果:a = 250, b = hello, c = 22.22
s = "a=250,b=hello,c=22.22";
//参数表示按逗号分隔, 拆分出第0段到第1段, 保存到tmp
QString tmp = s.section(",", 0, 1);
qDebug()<<"tmp = "<<tmp;
//输出结果:tmp="a=250,b=hello"
s = "a=250,b=hello,c=22.22";
//参数表示按逗号分隔, 拆分出第0段到第0段, 保存到tmp
QString tmp = s.section(",", 0, 0);
qDebug()<<"tmp = "<<tmp;
//输出结果:tmp="a=250"
tmp = tmp.section("=", 1, 1);
qDebug()<<"tmp="<<tmp;
//输出结果:tmp="250";
//QString转int
int a = tmp.toInt();
qDebug()<<"a="<<a;
//输出结果:a=250;
//int转QSt