QCustomPlot接受一个QVector<double>变量。我的QTableView以QVector<QString>的形式包含数据,这是想要绘制的。
发布于 2015-05-05 06:45:25
已更新
正如注释所述,您需要一个如下所示的转换函数:
QVector< double > toFloatVector( const QVector< QString >& aVector )
{
QVector< double > vector;
for ( const auto& item : aVector )
{
bool ok = true;
const double value = item.toDouble( &ok );
if ( ok )
{
vector << value;
}
// ... do something if the conversion failes.
}
return vector;
}https://stackoverflow.com/questions/30045444
复制相似问题