上代码:
QString strtem=QString(temp);
int i=0;
if(temcur==24)
temcur=0;
// tem[temcur]=strtem.mid(2,5).toFloat();//转换
//随机数
i=rand()%100;
strtem= QString::number(i);
strtem="27."+strtem; //组合
tem[temcur]=strtem.toFloat();
qDebug()<< tem[temcur]<<'\n'; //输出调试信息
temcur++;
if(hcur==24)
hcur=0;
i=rand()%100;
strtem= QString::number(i);
strtem="64."+strtem;
shidu[hcur]=strtem.toFloat();
qDebug()<< shidu[hcur]<<'\n';