Q3DSurface *graph = new Q3DSurface();
graph->setFlags(graph->flags() ^ Qt::FramelessWindowHint);
//创建数据对象
QSurfaceDataArray *data = new QSurfaceDataArray;
QSurfaceDataRow *dataRow1 = new QSurfaceDataRow;
QSurfaceDataRow *dataRow2 = new QSurfaceDataRow;
//为数据对象赋值
*dataRow1 << QVector3D(0.0f, 0.1f, 0.5f) << QVector3D(1.0f, 0.5f, 0.5f);
*dataRow2 << QVector3D(0.0f, 1.8f, 1.0f) << QVector3D(1.0f, 1.2f, 1.0f);
//*data << dataRow1 << dataRow2;
data->append(dataRow1);
data->append(dataRow2);
//创建序列,加入数据,添加到Q3DSurface
QSurface3DSeries *series = new QSurface3DSeries;
series->dataProxy()->resetArray(data);
graph->addSeries(series);
graph->setWidth(800);
graph->setHeight(600);
graph->show();