当前位置: 首页 > 工具软件 > 3DGraph > 使用案例 >

QAbstract3DGraph 隐藏坐标系显示

燕照
2023-12-01


int main(int argc, char** argv)
{
    QGuiApplication app(argc, argv);

    Q3DSurface surface;
    surface.setFlags(surface.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;

    QSurface3DSeries* series = new QSurface3DSeries;
    series->dataProxy()->resetArray(data);
    surface.activeTheme()->setGridEnabled(false);
    surface.activeTheme()->setBackgroundEnabled(false);
    surface.activeTheme()->setLabelBackgroundEnabled(false);
    for (auto* plabel : surface.axes())
    {
        plabel->setLabelFormat(QString());
    }
    surface.addSeries(series);
    surface.show();

    return app.exec();
}
 

 类似资料: