Are there any QVTKOpenGLWidget examples since QVTKWidget is deprecated? I think I might be using it wrong. Here’s a little example of how I use vtkOpenGLWidget on windows (latest msvc):
QVTKOpenGLWidget* widget = new QVTKOpenGLWidget(); widget->resize(600, 600); vtkNew<vtkSphereSource> sphereSource; vtkNew<vtkPolyDataMapper> sphereMapper; sphereMapper->SetInputConnection(sphereSource->GetOutputPort()); vtkNew<vtkActor> sphereActor; sphereActor->SetMapper(sphereMapper); vtkNew<vtkRenderer> ren; ren->AddActor(sphereActor); vtkNew<vtkGenericOpenGLRenderWindow> renWindow; widget->SetRenderWindow(renWindow); renWindow->AddRenderer(ren); widget->show();
However when I do the same thing on Mac OSX 14.4 with Clang it breaks on line 292 of vtkOpenGLRenderTimer in function ReusableStart(). Saying EXC_BAD_ACCESS. Additionally I get this warning:
“VTK is designed to work with OpenGL version 3.2 but it appears it has been given a context that does not support 3.2. VTK will run in a compatibility mode designed to work with earlier versions of OpenGL but some features may not work.”
I’m using VTK 8.1.2 I haven’t tried it with VTK 8.2 as it lacks some of the modules I need. Additionally I should mention QVTKWidget works fine on mac and windows. Any help would be much appreciated.