Qt取中括号中的浮点数(不分正负)
用stringstream提取字符串中的浮点数
QVector<float>v_f;
if(str.indexOf(rex) >= 1){
std::string s = "[-23.6655 56.2235 -653.5616]";
std::stringstream stream(s);
typedef std::istream_iterator<std::string>it ;
for_each(it(stream),it(),[&](const std::string &s){v_f.push_back(atof(s.c_str()));});
qDebug() << v_f.at(0) << v_f.size();
}