<div dir="ltr">Dear all,<div><br></div><div>I am using Qt 5.4 with vtk 6.2 on windows. I am facing some problem using QVtkWidget with vtkRenderWindowInteractor, It never returns once vtkrenderwindowinteractor->start() call. </div><div><br></div><div>When I close the QVtkWidget or main application but it still running in background.</div><div><br></div><div>my code is:</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">vtkImageViewer2</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkImageViewer2</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">imageViewer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(0,0,0)">SetInputData</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(reader-</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">></span><span style="font-family:arial,sans-serif">GetOutput</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">());</span><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(128,0,128)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkRenderWindowInteractor</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">*</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">renderWindowInteractor</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkRenderWindowInteractor</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">::</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">New</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetupInteractor</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">renderWindowInteractor</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">QVtkWidget</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">*</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">engine</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,128,0)">new</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">QVtkWidget</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">engine</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(0,0,0)">SetRenderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">imageViewer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">());</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">//</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">make</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">the</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">link</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">between</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">VTK</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">and</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,128,0)">QT</span><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">renderWindowInteractor</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">SetRenderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">imageViewer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">());</span><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">engine</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">show</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">imageViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">()-></span><span style="font-style:italic;color:rgb(0,0,0)">Render</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">//renderWindowInteractor</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Initialize</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">engine</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetRenderWindow</span><span style="color:rgb(0,0,0)">()-></span><span style="font-style:italic;color:rgb(0,0,0)">GetInteractor</span><span style="color:rgb(0,0,0)">()-></span><span style="font-style:italic;color:rgb(0,0,0)">Start</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//renderWindowInteractor->Start();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">cerr<span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(0,128,0)">"exit"</span><span style="color:rgb(0,0,0)">;</span></pre></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">How I can return from vtkRenderWindowInteractor->Start() function ?</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">Thanks.</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">--</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">Muhammad Jawad  </span></pre></pre></div></div>