Reputation: 24151
I want to use the VTK widget in Qt Creator. So, I downloaded and installed Qt Creator 4, and in /usr/lib/qt4/plugins/designer
there is now the file libQVTKWidgetPlugin.so
. However, on starting a new Qt Creator Widgets project, and entering the Design tab, there are no additional widgets listed on the left, only the default ones such as Push Button, Label, etc. What additional steps do I need to show the VTK widget so that I can just drag and drop it onto the GUI I am building?
Upvotes: 0
Views: 8273
Reputation: 9701
Promoting a normal widget or simply changing the code behind the widget class to inherit from the VTK one is the best way to do it imho. The problem with the VTK widget plugin for Qt creator is that you have to keep it up to date with your Qt creator. Even when you update your VTK build with a newer version of Qt you still have to keep the old one around plus the sources of Qt Creator. You cannot use a plugin for Qt Creator built with a different version of Qt from the one your Creator is using. This is an overhead that is rarely worth the trouble.
Upvotes: 1
Reputation: 3615
A lot of time later but... maybe you can add a QWidget and promote it to QVTKwidget. I saw it here http://hxr99.blogspot.com.co/2013/03/qt-vtk-displaying-dicom-series-using.html . It may not appear listed as a widget, but if the libraries are correctly installed it will still compile and find everything.
Upvotes: 0
Reputation: 6123
Well, I worked with VTK and Qt almost a year ago, I hope that the refernces I have still valid nowadays.
If so, you should go under C:\vtk\VTK5.10.1\vs10\bin\Release
(or a similar path, depending on the version of VTK you've installed), and localize two files: QVTKWidgetPlugin.lib
and QVTKWidgetPlugin.dll
. If they are there, there are good chances you've built VTK properly.
Now copy those files in C:\Qt\4.x.x\plugins\designer
.
if everything goes well, then open the QT designer. You will find the VTK WINDOW WIDGET
at the bottom of the qt widget list like this snapshot:
Reference: http://guitarcplusplus.blogspot.it/2013/02/itk-vtk-qt-on-window-7-64bit-and-visual.html
Upvotes: 1