[vtkusers] VTK and QtQuick 2
Olivier Comas
ocomas at apelem.com
Mon Jan 11 07:12:34 EST 2016
Hi everyone,
I was wondering if anyone managed to integrate VTK and Qt Quick 2. I found this post: https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6 which gives an example of integration. And it works great with VTK 6.3. But using the OpenGL2 backend in 6.3 or using VTK 7.0 rc, it crashes in OpenGLInitState() at the first OpenGL call. Even a call to “glEnable(GL_DEBUG_OUTPUT);” crashes. I checked the handle returned by wglGetCurrentContext() and it’s not NULL so it seems to have a valid OpenGL context. That would be awesome to be able to use the “new” VTK rendering backend along with a GUI made with Qt Quick 2.
I also found this post from Kitware: http://www.kitware.com/blog/home/post/688. If I understand correctly, ExternalVTKWidget seems to be a helper class for making it easier to use vtkExternalOpenGLRenderWindow, vtkExternalOpenGLRender and vtkExternalOpenGLCamera. But I could not find any working example. How is it supposed to be used? Could we use those classes in a class inheriting from QWindow so VTK can use the OpenGL context created by Qt? It is how those classes are intented to be used?
Do you intend to release a QVTKQuickItem or QVTKWindow at some point? I know there is a QVTKWidget but there is nothing for Qt Quick. From my understanding, ExternalVTKWidget could be used for QtQuick integration. So do you intent to release a class to support QtQuick? An example on how to use ExternalVTKWidget would be great already.
Any help would be greatly appreciated.
Regards,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160111/0c3a9781/attachment.html>
More information about the vtkusers
mailing list