Install QVTK plugin

Using QVTKwidget

Assuming that you have built a shared build of VTK and you may or may
not have a set it up such that there is a path to the release version
of VTK in your PATH statement.

Then if you debug a project that is using QVTKWidget, you will come
across a problem in that if you are debugging a debug version; the
application depends upon the debug version of QVTK.dll which will
depend upon QtGui4.dll (among others) and load it. But, because the
release version of QVTK.dll is in the path, QtGiu4.dll will also be
loaded preventing the application from running. You will get a
"QWidget: Must construct a QApplication before a QPaintDevice"
message.

The solution to this problem is to set the path to the correct builld
of VTK on the "Debugging" properties of your project. Right click on
your project, bring up the properties dialog, and select "Debugging"
from the list on the left. There should be an "Environment" line. You
can add variables here using key=value pairs.
For example, add the following line:
PATH=\Kitware\build\VTK\bin\$(OutDir);%PATH%
You can then add the same line to other configurations, by selecting
them from the top left drop down box labelled Configuration.

$(OutDir) will be set by Visual Studio to either Debug or Release,
depending upon what configuration you have selected. Make sure that
;%PATH% is appended so that Qt and other files can be appended to the
PATH statement.


Plugin in QtDesigner

There are two versions of the Qt Designer – one as part of the (MSVC-based) QtCreator and another in the MinGW desktop development environment – of which only the MinGW-version can recognize the plugin.
I think that to use the plugin with designer, you might have to either compile your plugin with MSVC (like designer is by default), or compile designer with MinGw. The compilers (and compilation settings) for a program and its plugins need to match.

你可能感兴趣的:(ITK/VTK)