Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Q3DSurface how to remove axis labels and grids?



  • Hi,

    Does anyone know how to disable or hide the axis grids and value labels for a Q3DSurface?

    I'm working towards a 3D balloon plot and I don't need the labels and grids.

    Also, I'd like to plot multiple 'surfaces' on the one Q3DSurface widget but I haven't seen anything like this in the documentation. (I've successfully done this in Matlab.)

    Kind regards,
    Michael



  • @mjsmithers

    Have you found a solution?

    Edit:
    To disable the grid:

    Q3DSurface *surface = new Q3DSurface();
    surface->activeTheme()->setGridEnabled(false);
    

    And a more or less ugly solution for the labels:

    surface->activeTheme()->setLabelBackgroundColor(Qt::white);
    surface->activeTheme()->setLabelBorderEnabled(false);
    surface->activeTheme()->setLabelTextColor(Qt::white);
    

    or

    surface->axisX()->setLabelFormat("");
    surface->axisY()->setLabelFormat("");
    surface->axisZ()->setLabelFormat("");
    


  • No I didn't find a solution. Thanks very much for the suggestions.

    In the end I implemented my own 3D balloon plotting QT widget which renders in openGL.


Log in to reply