相关文章推荐
耍酷的大象  ·  macOS ...·  2 月前    · 
豪情万千的台灯  ·  iOS ...·  7 月前    · 


QVector<QPointF> ReadSonicPoint::sortSonicPoint(QVector<QPointF> befPointVector) //把x轴的值从小到大排序
{
QVector<QPointF> modPointVector;
QMap<double, double>sonicMap; //利用QMap自动排序
for (int i = 0; i < befPointVector.size(); i++)
{
sonicMap.insert(befPointVector[i].x(), befPointVector[i].y());
}
QMap<double, double>::Iterator it = sonicMap.begin();
while (it!=sonicMap.end())
{
QPointF sonicPoint;
sonicPoint.setX(it.key());
sonicPoint.setY(it.value());
modPointVector.append(sonicPoint);
i++;
}
return modPointVector;
}