[vtkusers] vtkImageViewer2 and QVTKWidget

Marcos fotosentido at gmail.com
Thu Aug 27 15:02:18 EDT 2015


Hi Siavash,

thank you for responding, I appreciate it.

I added that line at the end, and I got a new window with the text:

ERROR: In C:\VTK-6.2.0\GUISupport\Qt\QVTKInteractor.cxx, line 147
QVTKInteractor (08ECEE60): QVTKInteractor cannot control the event loop.

On the other hand, I guess I know what the problem is. I didn't imagine it
could be that.

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.

So in my MainWindow form (Qt Designer) I put that ViewerWidget.

>From this code, I could access my QVTKWidget, but maybe it's not correctly
initiated.

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.

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-)

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.

I'll leave the QVTKWidget in the MainWindow.

Thanks for your time.

2015-08-27 20:30 GMT+02:00 Siavash Khallaghi <siavashk at ece.ubc.ca>:

> Hi Marcos,
>
> What if you try adding the following line to your code ;)
>
> ui->qvtkwidget->GetRenderWindow()->GetInteractor()->Start();
>
> Siavash
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/vtkImageViewer2-and-QVTKWidget-tp5733647p5733651.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150827/a2ecd65e/attachment.html>


More information about the vtkusers mailing list