int main(int argc, char *argv[])
{
QString strRaw = "1,2,3,4,5,6,7,8,9";
QStringList strList;
double strRawValue;
std::vector<int> strRawValue1;
QString strRawValue_String;
QString str_String;
strList = strRaw.split(","); //拆分字符串
qDebug() << "strList.size()="<<strList.size() << endl;
for (int i = 0; i < strList.size(); i++)
{
qDebug() << i + 1 << " : " << strList[i] << endl;
strRawValue = strList[i].toDouble(); //将QStringList字符串转化为数值
strRawValue1.push_back(strRawValue); // 将得到数值push_back到一起
//
strRawValue_String = QString::number(strRawValue,'F', 0); //将double数值转化为字符串,0表示保留0位小数
str_String = str_String.append(strRawValue_String); //将字符串append(),到一起;
}
qDebug() << strRawValue << endl;
QString strListConnect;
strListConnect = strList.join(","); //合并字符串
qDebug() << strListConnect << endl;
}