0

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?

3 Answers 3

1

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:

enter image description here

Reference: http://guitarcplusplus.blogspot.it/2013/02/itk-vtk-qt-on-window-7-64bit-and-visual.html

2
  • Thanks, but I'm working in Linux, and the only relevant file I have after building VTK is libQVTKWidgetPlugin.so, and there is no libQVTKWidgetPlugin.a (what would be the Linux equivalent of libQVTKWidgetPlugin..dll) ... Oct 27, 2014 at 11:21
  • OK, I see. Unfortunately, I've never worked with VTK on Linux; I think I cannot be on any help, there...
    – Andrea
    Oct 27, 2014 at 11:41
1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.