Changing QSurfaceFormat of a ThreeDWidget

Hello everyone,

I am trying to show a 3D view outside the view layout, to be able to activate the QuadBuffer stereo mode on Slicer 4.13 (with VTK9). I followed this example for the widget but using C++.

First, I created a VTK app which used QVTKOpenGLStereoWidget and I had to change the surface of the widget like this:

QVTKOpenGLStereoWidget widget;
QSurfaceFormat format;
format.setStereo(true);
widget.setFormat(format);

Or like this : QSurfaceFormat::setDefaultFormat(QVTKOpenGLStereoWidget::defaultFormat(1));

With the surface like this and some others parameters for the render window it works like a charm.

My problem is, now that I want to do it in Slicer, I must use the class threeDWidget. However, from what I understood, I cannot change the format of the ThreeDWidget (in the class qMRMLThreeDWidget), so I would like to know if there is another way for me to use the format I need. Or if I can use a Stereo widget inside Slicer rather than the threeDWidget class, so I’ll have direct access to the surface as I seen above.

Thank you for your help !

Regards

Have you figure this out? Have you managed to make the zspace device work in Slicer?