# QVTKOpenGLWidget Issue on Mac OSX

**URL:** https://discourse.vtk.org/t/qvtkopenglwidget-issue-on-mac-osx/828
**Category:** Support
**Created:** [April 24, 2019, 4:22am UTC](https://discourse.vtk.org/t/qvtkopenglwidget-issue-on-mac-osx/828 "2019-04-24T04:22:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [April 24, 2019, 4:22am UTC](https://discourse.vtk.org/t/qvtkopenglwidget-issue-on-mac-osx/828/1 "2019-04-24T04:22:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 29, 2019, 8:25am UTC](https://discourse.vtk.org/t/qvtkopenglwidget-issue-on-mac-osx/828/2 "2019-04-29T08:25:07Z")

</div>

Here it is :  
[https://lorensen.github.io/VTKExamples/site/Cxx/Qt/RenderWindowNoUiFile/](https://lorensen.github.io/VTKExamples/site/Cxx/Qt/RenderWindowNoUiFile/)
