<div dir="ltr">Hi Siavash,<div><br></div><div>thank you for responding, I appreciate it.</div><div><br></div><div>I added that line at the end, and I got a new window with the text:</div><div><br></div><div><div>ERROR: In C:\VTK-6.2.0\GUISupport\Qt\QVTKInteractor.cxx, line 147</div><div>QVTKInteractor (08ECEE60): QVTKInteractor cannot control the event loop.</div></div><div><br></div><div>On the other hand, I guess I know what the problem is. I didn't imagine it could be that.</div><div><br></div><div>This code is inside a .cpp from a class named ViewerWidget. ViewerWidget is a QWidget class, with an associated .ui file where I designed the widget: just a QVTKWidget inside.</div><div><br></div><div>So in my MainWindow form (Qt Designer) I put that ViewerWidget.</div><div><br></div><div>From this code, I could access my QVTKWidget, but maybe it's not correctly initiated.</div><div><br></div><div>Why do I think this is the problem? Because I added a QVTKWidget to MainWindow form, and passed a pointer to my ViewerWidget class. And the image is loaded and I can see it. </div><div><br></div><div>I've spent a lot of time trying different codes (as I said, I saw a lot of differents aproaches -renderers and interactors from one to another and viceversa, classes like VTKImageExport, setting to vtkActor, etc-)</div><div><br></div><div>Maybe I shouldn't create the widget and just have the QVTKWidget where I know it works, not inside another custom widget. I just wanted to encapsulate things.</div><div><br></div><div>I'll leave the QVTKWidget in the MainWindow.</div><div><br></div><div>Thanks for your time.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-27 20:30 GMT+02:00 Siavash Khallaghi <span dir="ltr"><<a href="mailto:siavashk@ece.ubc.ca" target="_blank">siavashk@ece.ubc.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marcos,<br>
<br>
What if you try adding the following line to your code ;)<br>
<br>
ui->qvtkwidget->GetRenderWindow()->GetInteractor()->Start();<br>
<br>
Siavash<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkImageViewer2-and-QVTKWidget-tp5733647p5733651.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/vtkImageViewer2-and-QVTKWidget-tp5733647p5733651.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>