[vtkusers] QvtkWidget 6.1 plugin in Qt5.2 Creator 3.0.0 fails with QWidget::paintEngine: Should no longer be called
Michael Arnold
myk321 at gmail.com
Fri Jan 3 23:25:48 EST 2014
Hi,
fedora 20, gcc 4.8.2, x86_64, 3.12.5-302.fc20.x86_64
When I try and run a Qt application with a libQVTKWidgetPlugin widget on a
form, the application fails at runtime with the message:
QWidget::paintEngine: Should no longer be called
I had understood from
http://vtk.1045678.n5.nabble.com/VTK-6-1-td5722746.html
that vtk 6.1 supports qt 5.
Steps taken:
Step 0: Remove existing qt4 libraries (this seems to confuse ccmake if qt4
and qt5 are present at the same time)
sudo yum remove qt4*
Step 1: Build vtk 6.1 from source (on 1 Jan I downloaded and built the
latest vtk 6.1 code from git):
sudo yum install git
git clone git://vtk.org/VTK.git vtk
mkdir vtkbuild
cd vtkbuild
ccmake ../vtk
c - for configure
set CMAKE_BUILD_TYPE to Release
set VTK_Group_Qt to ON
c - for configure
e - to exit help
t - for advanced mode
Page down to page 12 and modify
Set VTK_QT_VERSION to 5
c - for configure
<<QT5 folders are now shown>>
c - for configure
g - for generate
<<exits ccmake>>
make
Step 2: Download the latest qt5.2 and QT Creator 3.0 (the Qt Creator
packaged with fedora 20 "sudo yum install qt-creator*" see non functional)
download "Qt 5.2.0 for Linux 64-bit (423 MB)" from
http://qt-project.org/downloads
and unpack in ~ to give a ~/Qt5.2.0 folder
Step 3: Copy across libQVTKWidgetPlugin.so
cp ~/vtkbuild/lib/libQVTKWidgetPlugin.so
~/Qt5.2.0/Tools/QtCreator/bin/plugins/designer/
In CT Creator the VTK widget is now visible in the form designer.
Step 4: Create a new QT project
Add QVTKWidgetPlugin to a form
Modify the QT .pro file with
INCLUDEPATH += /home/myk/5.2.0/gcc_64/include/QtWidgets/
INCLUDEPATH += /home/myk/vtk/Rendering/Core/
INCLUDEPATH += /home/myk/vtk/Common/Core/
INCLUDEPATH += /home/myk/vtk/Common/DataModel/
INCLUDEPATH += /home/myk/vtk/Common/ExecutionModel/
INCLUDEPATH += /home/myk/vtk/Filters/Sources/
INCLUDEPATH += /home/myk/vtk/GUISupport/Qt/
INCLUDEPATH += /home/myk/vtkbuild/Common/Core/
INCLUDEPATH += /home/myk/vtkbuild/Common/DataModel/
INCLUDEPATH += /home/myk/vtkbuild/Common/ExecutionModel/
INCLUDEPATH += /home/myk/vtkbuild/Filters/Sources/
INCLUDEPATH += /home/myk/vtkbuild/GUISupport/Qt/
INCLUDEPATH += /home/myk/vtkbuild/Interaction/Style/
INCLUDEPATH += /home/myk/vtkbuild/Rendering/Core/
INCLUDEPATH += /home/myk/vtkbuild/Rendering/OpenGL/
LIBS += -L/home/myk/vtkbuild/lib
unix: LIBS += -lvtkCommonCore-6.1
unix: LIBS += -lvtkCommonExecutionModel-6.1
unix: LIBS += -lvtksys-6.1
unix: LIBS += -lQVTKWidgetPlugin
unix: LIBS += -lvtkChartsCore-6.1
unix: LIBS += -lvtkViewsQt-6.1
unix: LIBS += -lvtkInteractionWidgets-6.1
unix: LIBS += -lvtkInfovisCore-6.1
unix: LIBS += -lvtkRenderingCore-6.1
unix: LIBS += -lvtkRenderingOpenGL-6.1
unix: LIBS += -lvtkImagingCore-6.1
#unix: LIBS += -lvtkIO-6.1
#unix: LIBS += -lvtkFiltering-6.1
unix: LIBS += -lvtklibxml2-6.1
unix: LIBS += -lvtkDICOMParser-6.1
unix: LIBS += -lvtkpng-6.1
unix: LIBS += -lvtktiff-6.1
unix: LIBS += -lvtkzlib-6.1
unix: LIBS += -lvtkjpeg-6.1
unix: LIBS += -lvtkalglib-6.1
unix: LIBS += -lvtkexpat-6.1
unix: LIBS += -lvtkverdict-6.1
unix: LIBS += -lvtkmetaio-6.1
unix: LIBS += -lvtkNetCDF-6.1
unix: LIBS += -lvtksqlite-6.1
unix: LIBS += -lvtkexoIIc-6.1
unix: LIBS += -lvtkftgl-6.1
unix: LIBS += -lvtkfreetype-6.1
unix: LIBS += -lvtkFiltersSources-6.1
unix: LIBS += -lvtkGUISupportQt-6.1
And then add the following to the QT Creator build environment:
LD_LIBRARY_PATH
with a value of:
/home/myk/vtk/GUISupport/Qt/
as per:
http://www.qtforum.org/article/18473/tutorial-for-using-qt-with-vtk.html
Step 5: Run the application. The following is visible in the Application
Output window
Starting /home/myk/build-FrontEnd-Desktop-Release/FrontEnd...
QWidget::paintEngine: Should no longer be called
The program has unexpectedly finished.
/home/myk/build-FrontEnd-Desktop-Release/FrontEnd crashed
Any pointers would be appreciated.
Thanks and regards
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140104/de83e8f0/attachment.htm>
More information about the vtkusers
mailing list