title: Using QVTKWidget and QOpenGLWidget in the same UI?
body: <p>I'm working on a project that uses a custom subclass of <code>QOpenGLWidget</code> to display some renderings. At the end of the <code>paintGL()</code> method it calls the widget's <code>update()</code> method to trigger a repaint event if it's visible.
  Now I want to add an additional <code>QVTKWidget</code> to my Ui and I do so by using something like this:</p>
  
  <pre><code>QVBoxLayout* layout = findChild&lt;QVBoxLayout*&gt;("layout_simulation");
  QVTKWidget* widget = new QVTKWidget();
  
  // Setup arrow
  vtkSmartPointer&lt;vtkArrowSource&gt; arrowSource = vtkSmartPointer&lt;vtkArrowSource&gt;::New();
  
  [more VTK stuff...]
  
  widget-&gt;GetRenderWindow()-&gt;AddRenderer(renderer);
  renderer-&gt;AddActor(arrowActor);
  renderer-&gt;ResetCamera();
  
  // Add widget to ui
  layout-&gt;addWidget(widget);
  </code></pre>
  
  <p>The VTK widget is added to the ui and is working as intended. The problem is that as soon as I use the <code>layout-&gt;addWidget()</code> method <strong>all my other <code>QOpenGLWidget</code> objects turn black</strong> and don't display anything. Also this black is not the background color of the <code>VTKRenderer</code> because the other widgets are still black even if I change the background color of the VTK widget. I checked and the <code>paintGL()</code> still gets called in a loop but it just doesn't display anything. I'm pretty sure that I didn't use any bad OpenGL code in my widget subclass so I guess it has something to do with the internal initialization of <code>QOpenGLWidget</code> and <code>QVTKWidget</code>. The same happens if I omit all the VTK calls and just add the newly created <code>QVTKWidget</code>.</p>
  
  <p>The funny thing is that if I omit the <code>layout-&gt;addWidget()</code> call, VTK opens the renderer in a seperate window and all the OpenGL widgets work without a problem. But of course I want to embed the renderer in my ui.</p>
  
  <p>Does anyone have experience with this or do you know any pitfalls I might have stepped into or are there any common problems that may cause this?</p>
  
  <p>BTW: I use a OpenGL 3.3 core profile with custom shaders for my <code>QOpenGLWidget</code> subclass.</p>
  
  <p>EDIT: I removed my request for a 3.3 core profile and now it uses a 4.4 compatibility profile. I guess it's now using the same profile as the <code>VTKRenderer</code> so this can be ruled out as a source for the error.</p>