[vtkusers] Inresolved external for QVTKWidget in VTK-8.0.1.

Dan Lipsa dan.lipsa at kitware.com
Tue Oct 10 13:23:35 EDT 2017


In Qt Designer you should be able to use QVTKOpenGLWidget by adding first a
QOpenGLWidget and then 'Promote to ...' a QVTKOpenGLWidget. So you can
build the UI of your Qt application this way.

I am not sure what is needed for QtCreator. I don't use that.

Hope this helps,
Dan


On Tue, Oct 10, 2017 at 10:59 AM, Zoltan Kovacs <Zoltan.Kovacs at esi-group.com
> wrote:

> Dear Mike,
>
> Thank you very much for your prompt answer. As I wrote to Dan, we have to
> use QtCreator for the development here. Then I have access only for qmake
> and I can edit project files for it. If QVTKOpenGLWidget is the only VTK
> widget class supported for Qt5 then I ave to find out how to insert such an
> object into the UI form file of QT.
>
> Kind regards,
> Zoltan
>
> Am 10.10.2017 um 16:48 schrieb Mike Chinander:
>
>> Also, when working with VTK, it will be a lot easier to switch to using
>> CMake instead of Qt project files (QtCreator supports CMake). Look at the
>> examples Dan linked to. You will have to update the CMakelists.txt file for
>> Qt. You will probably have to add the following:
>>
>> FIND_PACKAGE(Qt5Core REQUIRED)
>> FIND_PACKAGE(Qt5Widgets REQUIRED)
>>
>> and update the target_link_libraries line(add Qt5::Widget) , e.g.,:
>>
>> target_link_libraries(QtBarChart Qt5::Widgets ${VTK_LIBRARIES})
>>
>> On Tue, Oct 10, 2017 at 9:33 AM, Dan Lipsa <dan.lipsa at kitware.com
>> <mailto:dan.lipsa at kitware.com>> wrote:
>>
>>     Zoltan,
>>     This is unrelated to the error you are seeing however:
>>
>>     For Qt5 you'll need to use QVTKOpenGLWidget rather than QVTKWidget.
>> See
>>     https://lorensen.github.io/VTKExamples/site/Cxx/
>>     <https://lorensen.github.io/VTKExamples/site/Cxx/>
>>     All examples are converted to Qt5. Also, VTK master has a number of
>>     examples that have been converted to Qt5: Examples/GUI/Qt
>>
>>     Hope this helps,
>>     Dan
>>
>>
>>     On Tue, Oct 10, 2017 at 10:10 AM, Zoltan Kovacs
>>     <Zoltan.Kovacs at esi-group.com <mailto:Zoltan.Kovacs at esi-group.com>>
>>
>>     wrote:
>>
>>         Dear all,
>>
>>         In CMake I generated a solution project of VTK-8.0.1 with Qt5
>>         support for MSVS2013. After having run the ALL_BUILD and INSTALL
>>         projects with the install prefix C:\VTK\8.0.1 in VM2013 I could
>>         installed the Win32 bit binaries of VTK 8.0.1 in that folder.
>>         The header files and the libraries are located in
>>         C:\VTK\8.0.1\include\vtk-8.0   and
>>         C:\VTK\8.0.1\lib.
>>
>>         I copied the file QVTKWidgetPlugin.dll from the VTK binary
>>         folders to the plugin folder of QTCreator, which uses QT 5.8
>>         msvs2013 32 bit version.
>>
>>         Then I set the include and library paths and added all the VTK
>>         libary files from C:\VTK\8.0.1\lib for the linker setting in the
>>         project file
>>         of a QT application in QtCreator:
>>
>>         INCLUDEPATH += C:\VTK\8.0.1\include\vtk-8.0
>>         LIBS += -LC:\VTK\8.0.1\lib
>>
>>         LIBS += -lvtkRenderingLabel-8.0 \
>>         -lvtkRenderingLOD-8.0 \
>>         -lvtkRenderingOpenGL2-8.0 \
>>         -lvtkRenderingQt-8.0 \
>>         -lvtkRenderingVolume-8.0 \
>>         -lvtkRenderingVolumeOpenGL2-8.0 \
>>         -lvtksqlite-8.0 \
>>         -lvtksys-8.0 \
>>         -lvtkTestingGenericBridge-8.0 \
>>         -lvtkTestingIOSQL-8.0 \
>>         -lvtkTestingRendering-8.0 \
>>         -lvtktiff-8.0 \
>>         -lvtkverdict-8.0 \
>>         -lvtkViewsContext2D-8.0 \
>>         -lvtkViewsCore-8.0 \
>>         -lvtkViewsInfovis-8.0 \
>>         -lvtkViewsQt-8.0 \
>>         -lvtkzlib-8.0 \
>>         -lvtkalglib-8.0 \
>>         -lvtkChartsCore-8.0 \
>>         -lvtkCommonColor-8.0 \
>>         -lvtkCommonComputationalGeometry-8.0 \
>>         -lvtkCommonCore-8.0 \
>>         -lvtkCommonDataModel-8.0 \
>>         -lvtkCommonExecutionModel-8.0 \
>>         -lvtkCommonMath-8.0 \
>>         -lvtkCommonMisc-8.0 \
>>         -lvtkCommonSystem-8.0 \
>>         -lvtkCommonTransforms-8.0 \
>>         -lvtkDICOMParser-8.0 \
>>         -lvtkDomainsChemistry-8.0 \
>>         -lvtkDomainsChemistryOpenGL2-8.0 \
>>         -lvtkexoIIc-8.0 \
>>         -lvtkexpat-8.0 \
>>         -lvtkFiltersAMR-8.0 \
>>         -lvtkFiltersCore-8.0 \
>>         -lvtkFiltersExtraction-8.0 \
>>         -lvtkFiltersFlowPaths-8.0 \
>>         -lvtkFiltersGeneral-8.0 \
>>         -lvtkFiltersGeneric-8.0 \
>>         -lvtkFiltersGeometry-8.0 \
>>         -lvtkFiltersHybrid-8.0 \
>>         -lvtkFiltersHyperTree-8.0 \
>>         -lvtkFiltersImaging-8.0 \
>>         -lvtkFiltersModeling-8.0 \
>>         -lvtkFiltersParallel-8.0 \
>>         -lvtkFiltersParallelImaging-8.0 \
>>         -lvtkFiltersPoints-8.0 \
>>         -lvtkFiltersProgrammable-8.0 \
>>         -lvtkFiltersSelection-8.0 \
>>         -lvtkFiltersSMP-8.0 \
>>         -lvtkFiltersSources-8.0 \
>>         -lvtkFiltersStatistics-8.0 \
>>         -lvtkFiltersTexture-8.0 \
>>         -lvtkFiltersTopology-8.0 \
>>         -lvtkFiltersVerdict-8.0 \
>>         -lvtkfreetype-8.0 \
>>         -lvtkGeovisCore-8.0 \
>>         -lvtkgl2ps-8.0 \
>>         -lvtkglew-8.0 \
>>         -lvtkGUISupportQt-8.0 \
>>         -lvtkGUISupportQtSQL-8.0 \
>>         -lvtkhdf5_hl-8.0 \
>>         -lvtkhdf5-8.0 \
>>         -lvtkImagingColor-8.0 \
>>         -lvtkImagingCore-8.0 \
>>         -lvtkImagingFourier-8.0 \
>>         -lvtkImagingGeneral-8.0 \
>>         -lvtkImagingHybrid-8.0 \
>>         -lvtkImagingMath-8.0 \
>>         -lvtkImagingMorphological-8.0 \
>>         -lvtkImagingSources-8.0 \
>>         -lvtkImagingStatistics-8.0 \
>>         -lvtkImagingStencil-8.0 \
>>         -lvtkInfovisCore-8.0 \
>>         -lvtkInfovisLayout-8.0 \
>>         -lvtkInteractionImage-8.0 \
>>         -lvtkInteractionStyle-8.0 \
>>         -lvtkInteractionWidgets-8.0 \
>>         -lvtkIOAMR-8.0 \
>>         -lvtkIOCore-8.0 \
>>         -lvtkIOEnSight-8.0 \
>>         -lvtkIOExodus-8.0 \
>>         -lvtkIOExport-8.0 \
>>         -lvtkIOExportOpenGL2-8.0 \
>>         -lvtkIOGeometry-8.0 \
>>         -lvtkIOImage-8.0 \
>>         -lvtkIOImport-8.0 \
>>         -lvtkIOInfovis-8.0 \
>>         -lvtkIOLegacy-8.0 \
>>         -lvtkIOLSDyna-8.0 \
>>         -lvtkIOMINC-8.0 \
>>         -lvtkIOMovie-8.0 \
>>         -lvtkIONetCDF-8.0 \
>>         -lvtkIOParallel-8.0 \
>>         -lvtkIOParallelXML-8.0 \
>>         -lvtkIOPLY-8.0 \
>>         -lvtkIOSQL-8.0 \
>>         -lvtkIOTecplotTable-8.0 \
>>         -lvtkIOVideo-8.0 \
>>         -lvtkIOXML-8.0 \
>>         -lvtkIOXMLParser-8.0 \
>>         -lvtkjpeg-8.0 \
>>         -lvtkjsoncpp-8.0 \
>>         -lvtklibharu-8.0 \
>>         -lvtklibxml2-8.0 \
>>         -lvtkLocalExample-8.0 \
>>         -lvtklz4-8.0 \
>>         -lvtkmetaio-8.0 \
>>         -lvtknetcdf_c++ \
>>         -lvtkNetCDF-8.0 \
>>         -lvtkoggtheora-8.0 \
>>         -lvtkParallelCore-8.0 \
>>         -lvtkpng-8.0 \
>>         -lvtkproj4-8.0 \
>>         -lvtkRenderingAnnotation-8.0 \
>>         -lvtkRenderingContext2D-8.0 \
>>         -lvtkRenderingContextOpenGL2-8.0 \
>>         -lvtkRenderingCore-8.0 \
>>         -lvtkRenderingFreeType-8.0 \
>>         -lvtkRenderingGL2PSOpenGL2-8.0 \
>>         -lvtkRenderingImage-8.0 \
>>
>>
>>         However, if I add a QVTKWidget on the UI file of the
>>         application, include the file QVTKWidget.h in the header file of
>>         the application and I try to link it in QtCreator with the
>>         32-bit VTK and Qt libraries, MSVS2013 (in the toolchain of
>>         QtCreator) sends error messages for unresolved external symbols
>>         for all the functions/classes belonging to the QVTKWidget, such as
>>
>>         distortionpage.obj:-1: Fehler: LNK2019: unresolved external
>>         symbol "__declspec(dllimport) public: __thiscall
>>         QVTKWidget::QVTKWidget(class QWidget *,class QFlags<enum
>>         Qt::WindowType>)"
>>         (__imp_??0QVTKWidget@@QAE at PAVQWidget@@V?$QFlags at W4WindowType@Qt@
>> @@@@Z)
>>         referenced in function "public: void __thiscall
>>         Ui_DistortionPage::setupUi(class QWidget *)"
>>         (?setupUi at Ui_DistortionPage@@QAEXPAVQWidget@@@Z)
>>
>>
>>         It seems that the linker could not find the libary for the
>>         QVTKWidget plugin, which is loaded since I could chose QtWidget
>>         from the widget list in the UI form editor in QtCreator. I do
>>         not see any ABI issue here since I use the 32 bit mscv2103
>>         version of Qt and I also compiled and linked the 32 bit version
>>         of VTK libaries and plugin files with MSVS2013. I am wondering
>>         if anybody could make VTK-8.1 working with Qt. Thanks a lot.
>>
>>         Kind regars,
>>         Zoltan
>>
>>         Regards,
>>         Zoltan
>>
>>         Am 09.10.2017 um 07:34 schrieb support at qt.io <mailto:
>> support at qt.io>:
>>
>>             Hi Zoltan,
>>
>>             I don't know how the widget should be installed or set up in
>>             a project, but you could just search for the header file and
>>             point INCLUDEPATH to the folder that contains it.
>>
>>             Regards,
>>             Joni
>>
>>             On 06 October 2017 at 18:26:00 EEST
>>             Zoltan.Kovacs at esi-group.com
>>             <mailto:Zoltan.Kovacs at esi-group.com> wrote:
>>
>>                 Hi Joni,
>>
>>                 I see. However I found MSCV2013 32 bit version for Qt
>>                 5.8. I install
>>                 that version and I built the VTK binaries for win32
>>                 platform with
>>                 MVS2013. After having copied the VTK plugin file into
>>                 the plugin folder
>>                 of QtCreator I could launch it successfully. The
>>                 QVTKWidget is in the
>>                 Widget list of QtCreator now. I could insert a
>>                 QVTKWidget in the UI form
>>                 as well. The only problem now is that QtCreator cannot
>>                 find the header
>>                 file for QVTKWidget. It is not cleat how to set the
>>                 INCLUDEPATH in the
>>                 project file since VS2103 did not create a separate
>>                 include folder in
>>                 the target folder C:/VTK/bin for the VTK binaries. Only
>>                 the library
>>                 files have a separate folder, C:/VTK/bin/lib/Release.
>>
>>                 Regards,
>>                 Zoltan
>>
>>                 Am 06.10.2017 um 12:08 schrieb support at qt.io
>>                 <mailto:support at qt.io>:
>>
>>                     Hi Zoltan,
>>
>>                     On 06 October 2017 at 13:00:00 EEST
>>                     Zoltan.Kovacs at esi-group.com
>>                     <mailto:Zoltan.Kovacs at esi-group.com> wrote:
>>
>>                         Hi Joni,
>>
>>                         Thank you very much for your answer. Then I try
>>                         to install everything
>>                         from scratch. The only prolem is I have only
>>                         MSVC 2103 and the only
>>                         option in the selection list of the online
>>                         installer for MSVC 2013 is
>>                         the 64 bit version. Is there somewhere an
>>                         installer on your website wich
>>                         provides a relatively new Qt version with MSVC
>>                         2103 32 bit version?
>>                         Thank you very much for your help.
>>
>>
>>                     No, but you could compile it from source yourself.
>>                     However, note that you cannot build plugins for new
>>                     Qt Creator with MSVC 2013 as it uses different ABI.
>>                     You could use MSVC 2015 or MSVC 2017.
>>
>>                     Or you could build 64bit version of Qt Creator from
>>                     source with that Qt version you have installed.
>>
>>                     Regards,
>>                     Joni
>>                     --
>>                     Joni Poikelin
>>                     Software Engineer,
>>                     The Qt Company
>>>>                     FAQs - https://wiki.qt.io/KnowledgeBase:SupportFAQ
>>                     <https://wiki.qt.io/KnowledgeBase:SupportFAQ>
>>
>>             --
>>             Joni Poikelin
>>             Software Engineer,
>>             The Qt Company
>>>>             FAQs - https://wiki.qt.io/KnowledgeBase:SupportFAQ
>>             <https://wiki.qt.io/KnowledgeBase:SupportFAQ>
>>
>>         _______________________________________________
>>         Powered by www.kitware.com <http://www.kitware.com>
>>
>>         Visit other Kitware open-source projects at
>>         http://www.kitware.com/opensource/opensource.html
>>         <http://www.kitware.com/opensource/opensource.html>
>>
>>         Please keep messages on-topic and check the VTK FAQ at:
>>         http://www.vtk.org/Wiki/VTK_FAQ <http://www.vtk.org/Wiki/VTK_FAQ>
>>
>>         Search the list archives at:
>>         http://markmail.org/search/?q=vtkusers
>>         <http://markmail.org/search/?q=vtkusers>
>>
>>         Follow this link to subscribe/unsubscribe:
>>         http://public.kitware.com/mailman/listinfo/vtkusers
>>         <http://public.kitware.com/mailman/listinfo/vtkusers>
>>
>>
>>
>>     _______________________________________________
>>     Powered by www.kitware.com <http://www.kitware.com>
>>
>>     Visit other Kitware open-source projects at
>>     http://www.kitware.com/opensource/opensource.html
>>     <http://www.kitware.com/opensource/opensource.html>
>>
>>     Please keep messages on-topic and check the VTK FAQ at:
>>     http://www.vtk.org/Wiki/VTK_FAQ <http://www.vtk.org/Wiki/VTK_FAQ>
>>
>>     Search the list archives at: http://markmail.org/search/?q=vtkusers
>>     <http://markmail.org/search/?q=vtkusers>
>>
>>     Follow this link to subscribe/unsubscribe:
>>     http://public.kitware.com/mailman/listinfo/vtkusers
>>     <http://public.kitware.com/mailman/listinfo/vtkusers>
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171010/cea9ab0f/attachment.html>


More information about the vtkusers mailing list