QVTKOpenGLNativeWidget requires a `vtkGenericOpenGLRenderWindow`. ` vtkWin32OpenGLRenderWindow ` is not supported.


I am using Qt 5.15.0 framework and my VTK version is 9.0.
I am new to VTK and I am working on reading the DICOM image application in Qt framework using VTK. The application is showing the DICOM image in a separate window, but I want the DICOM image to be executed in the MainWindow.

I have attached a screenshot of the error and also I got the following error.

QVTKOpenGLNativeWidget requires a vtkGenericOpenGLRenderWindow. vtkWin32OpenGLRenderWindow is not supported.

How to deal with this?

Thanks in advance.

Use a vtkGenericOpenGLRenderWindow instead of a vtkWin32OpenGLRenderWindow.

But, I checked my code, I have replaced vtkWin32OpenGLRenderWindow with vtkGenericOpenGLRenderWindow and it still shows the same error.

Is there any other place i have to look anywhere like in VTK sources files?

Nope, it must be in your code.

Just put a breakpoint in the vtkWin32OpenGLRenderWindow constructor.

I tried and it’s still the same. I also created a new project and I built , still the error is same.
Is there any alternate solution or any other library ?

Thanks in advance.

Maybe post you code will be better.