0

Hie, I am new to VTK.I want to use QVTKPluginWidget in Qt designer. I am using Visual Studio 2008 with MSVC compiler CMake- 2.8.10.1 Qt Version -4.8.3 VTK - 5.0

As per VTK User's Guide we have to configure VTK Lib with Cmake with setting few options like,

VTK_USE_GUISUPPORT=Turn On
configure
Desired Qt version cmake take itself
configure
then
set qt_qmake_executable
ON Build Example
configure


after doing this i am getting this warning in Cmake
CMake Warning (dev) at GUISupport/Qt/CMakeLists.txt:113 (ADD_LIBRARY):
  Policy CMP0003 should be set before this line.  Add code such as

    if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
    endif(COMMAND cmake_policy)

  as early as possible but after the most recent call to
  cmake_minimum_required or cmake_policy(VERSION).  This warning appears
  because target "QVTKWidgetPlugin" links to some libraries for which the
  linker must search:

    vfw32, opengl32

  and other libraries with known full path:

    C:/Qt/4.8.3/lib/QtGuid4.lib
    E:/DebugLibrary/VtkBin/bin/Debug/vtkRendering.lib

  CMake is adding directories in the second list to the linker search path
in
  case they are needed to find libraries from the first list (for backwards
  compatibility with CMake 2.4).  Set policy CMP0003 to OLD or NEW to enable
  or disable this behavior explicitly.  Run "cmake --help-policy CMP0003"
for
  more information.
This warning is for project developers.  Use -Wno-dev to suppress it.

Generating done

Then have to build this library in Visual studio then Copy the QVTKPluginWidget.dll in Plugin/Designer Folder. Then we should get QVTKWidget in designer

But i am not getting that in designer after doing this process.Kindly help me.

QT-ITK-VTK-Help
  • 548
  • 2
  • 6
  • 19
  • Did you turn off building shared libraries for VTK when you configured it? If not you would need to copy the dependent vtk dlls to the path that designer looks for dlls otherwise the plugin will not work. I recommend building vtk using static libraries unless you need tcl or python support. – drescherjm Dec 06 '12 at 15:05
  • Wait a minute. I think static lib may not work with the designer. I use static QVTK.lib libraries but I no longer use the designer plugin. – drescherjm Dec 06 '12 at 15:11

1 Answers1

0

You have to build VTK with BUILD_SHARED_LIBS=ON (as described here http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup) to use the widget in Designer.

David Doria
  • 9,873
  • 17
  • 85
  • 147
  • Its causing me dll errors and when I compiled in release mode with BUILD_SHARED_LIBS = OFF it generated QVTKPluginWidget.dll. – QT-ITK-VTK-Help Dec 18 '12 at 10:54
  • The problem was solved when I build library in release mode with keeping BUILD_SHARED_LIBS = OFF and then copied it to QTlib->plugins->designer folder. I'm working on VTK5.0 which is providing QVTKWidgetPlugin.dll in release mode build and BUILD_SHARED_LIBS=OFF, not in latest version as I checked. – QT-ITK-VTK-Help Dec 27 '12 at 05:24