I'm trying to use VTK in Qt Creator.
In Qt Designer, I have copied thelibQVTKWidgetPlugin.dylib into the plugin directory. Now I can create QVTKWidgets in Designer.
However, when I copy libQVTKWidgetPlugin.dylib into the
[QT dir]/QT Creator.app/Contents/Plugins/designer
folder and boot up QT Creator, it crashes before loading with the error "Qt Creator quit unexpectedly" (I can attach the full error if necessary).
Similarly, when I try to promote a QWidget to a QVTKWidget in the designer tab, any program I create with the QVTKWidget crashes with the same error.
Why is this?
The QT GUI examples included with VTK work with CMake.
My specs are: Mac OS X 10.10, VTK 6.1 (release mode, BUILD_SHARED_LIBS on, vtk_GUISupportQt on) Qt Creator 3.2.2 with Qt 5.3.2
Thanks in advance
Found the answer to my problem, so just in case someone has the same problem in the future:
The lines
#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
#define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)
need to be added before any #include
s in your project. For me, I can now promote QWidget to QVTKWidget (although placing the libQVTKWidgetPlugin still causes it to crash, but at least one method works).
Hope this can save someone the hours it took me to chance upon the solution!