QtOpenGLNativeWidget - here's a simple broken example

Here’s a simple example of loading the plastic skull that is similar to Medical4 demo.

If someone could see what’s wrong with this code that would be great…


Did you try with QVTKOpenGLWidget ?

Hello @DominionSoftware,
I was able to build and run your software (it’s missing #include to build properly here :wink: )

To fix your problem, you need to disable MSAA.
Insert vtkGenericOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples( 0 );
Before the line QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat()); in your main.
Here is the result

From my experience, I would strongly suggest not to use QVTKOpenGLWidget if possible, we had to deal with quite a lot of pb here with that class, stick to QtOpenGLNativeWidget if you don’t need stereo rendering :slight_smile:

1 Like


Rick Frank
Dominion Software, Inc.

825 Beacon Street

Newton, MA 02459

Medical, Scientific, and Industrial Software

@simonesneault : I fully agree with your QVTKopenGLWidget statement, It was just to provide a datapoint in order to fix the issue :slight_smile: