title: VTK Examples not working - QVTKOpenGLWidget?
body: <p>I tried getting into Qt and VTK and i had a lot of obstacles to get this far. google and stackoverflow helped me quite a lot but i can't solve this problem by myself. It is about the QVTKOpenGLWidget. I don't know how to get this and this example isn't working for me:</p>
  
  <p><a href="https://lorensen.github.io/VTKExamples/site/Cxx/Qt/RenderWindowUISingleInheritance/" rel="nofollow noreferrer">https://lorensen.github.io/VTKExamples/site/Cxx/Qt/RenderWindowUISingleInheritance/</a></p>
  
  <p>I also had to add the following line to the CMakeLists.txt:</p>
  
  <pre><code>SET(VTK_DIR "/path/to/cmake/vtk-8.0" CACHE PATH "VTK directory override" FORCE)
  </code></pre>
  
  <p>If i try to run it i get the following errormessages:</p>
  
  <p>RenderWindowUISingleInheritance.cxx:21:53: error: no matching function for call to ‘QVTKOpenGLWidget::SetRenderWindow(vtkNew&amp;)’
     this->ui->qvtkWidget->SetRenderWindow(renderWindow);</p>
  
  <p>RenderWindowUISingleInheritance.cxx:34:33: error: no matching function for call to ‘vtkRenderer::AddActor(vtkNew&amp;)’
     renderer->AddActor(sphereActor);</p>
  
  <p>RenderWindowUISingleInheritance.cxx:37:64: error: no matching function for call to ‘vtkRenderWindow::AddRenderer(vtkNew&amp;)’
     this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer);</p>
  
  <p>I don't know where this QVTKOpenGLWidget is coming from and how i get it but it seems like you have to use this instead of QVTKOpenWidget with Qt5 but it seems like it's not working? I don't have much experience with Qt or VTK in general. So it might be easy to solve.</p>
  
  <p>RenderWindowUISingleInheritance.cxx:</p>
  
  <pre><code>#include "RenderWindowUISingleInheritance.h"
  // This is included here because it is forward declared in
  // RenderWindowUISingleInheritance.h
  #include "ui_RenderWindowUISingleInheritance.h"
  
  #include &lt;vtkGenericOpenGLRenderWindow.h&gt;
  #include &lt;vtkNew.h&gt;
  #include &lt;vtkPolyDataMapper.h&gt;
  #include &lt;vtkRenderer.h&gt;
  #include &lt;vtkRenderWindow.h&gt;
  #include &lt;vtkSphereSource.h&gt;
  
  // Constructor
  RenderWindowUISingleInheritance::RenderWindowUISingleInheritance()
  {
    this-&gt;ui = new Ui_RenderWindowUISingleInheritance;
    this-&gt;ui-&gt;setupUi(this); //*1
  
    vtkNew&lt;vtkGenericOpenGLRenderWindow&gt; renderWindow;
    this-&gt;ui-&gt;qvtkWidget-&gt;SetRenderWindow(renderWindow); //*2
  
  
    // Sphere
    vtkNew&lt;vtkSphereSource&gt; sphereSource;
    sphereSource-&gt;Update();
    vtkNew&lt;vtkPolyDataMapper&gt; sphereMapper;
    sphereMapper-&gt;SetInputConnection(sphereSource-&gt;GetOutputPort());
    vtkNew&lt;vtkActor&gt; sphereActor;
    sphereActor-&gt;SetMapper(sphereMapper); //*3
  
    // VTK Renderer
    vtkNew&lt;vtkRenderer&gt; renderer;
    renderer-&gt;AddActor(sphereActor); //*4
  
    // VTK/Qt wedded
    this-&gt;ui-&gt;qvtkWidget-&gt;GetRenderWindow()-&gt;AddRenderer(renderer); //*5
  
    // Set up action signals and slots
    connect(this-&gt;ui-&gt;actionExit, SIGNAL(triggered()), this, SLOT(slotExit())); //*6
  
  }
  
  void RenderWindowUISingleInheritance::slotExit()
  {
    qApp-&gt;exit(); //*7
  }
  </code></pre>
  
  <p>It is also telling me the following things (marked the lines in the code with //*X):</p>
  
  <ol>
  <li>Class 'Ui_RenderWindowUISingleInheritance' doesn't have a function 'setupUI'</li>
  <li>Class 'Ui_RenderWindowUISingleInheritance' doesn't have a field 'qvtkWidget'</li>
  <li>Parameter type mismatch: Types 'vtkMapper*' and 'vtkNew' are not compatible</li>
  <li>Parameter type mismatch: Types 'vtkProp*' and 'vtkNew' are not compatible</li>
  <li>Class 'Ui_RenderWindowUISingleInheritance' doesn't have a field 'qvtkWidget'</li>
  <li>Class 'Ui_RenderWindowUISingleInheritance' doesn't have a field 'actionExit'</li>
  <li>Can't resolve variable 'qApp'</li>
  </ol>
  
  <p>I hope someone can help me since i want to get into VTK and Qt and this seems to be one of the last challenges before i can start working with them. Even if you can only help with a small part of this please let me know since every small step might help me to solve the rest by myself!</p>
  
  <p>Thanks in advance</p>