[vtkusers] VTK 8.0.1 with Qt 5.10.1

Elvis Stansvik elvis.stansvik at orexplore.com
Mon Mar 5 02:06:59 EST 2018


2018-03-01 23:27 GMT+01:00 Andrew J. Buckler (Elucid Bioimaging)
<andrew.buckler at elucidbio.com>:
> Hello,
>
> I have a successfully built and running application using VTK (multiple
> versions, including 8 and earlier) running with Qt 5.5.1. It uses QVTKWidget
> extensively. At this time I am working to upgrade to Qt 5.10.1, specifically
> pairing it with VTK 8.0.1.
>
>
> Having successfully built Qt from source, I built VTK as follows:
>
> tar -xvzf VTK-8.0.1.tar.gz
> mkdir VTK-8.0.1-build
> cd VTK-8.0.1-build
> cmake -DCMAKE_CXX_FLAGS=-std=c++11 -DBUILD_SHARED_LIBS:BOOL=OFF
> -DQT_QMAKE_EXECUTABLE:PATH=/usr/local/Qt-5.10.1/bin/qmake
> -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.10.1/ -DVTK_Group_Qt:BOOL=ON
> -DVTK_Group_Qt=1 -DVTK_QT_VERSION=5 ../VTK-8.0.1
> make -j4
> make install
>
>
> My application compiles and links without error on macOS 10.13, but the
> QVTKWidgets have erratic and inconsistent behavior.  Specifically:
>
> Two of them work perfectly well.
> Some of them do not work at all, that is, have either a blank content or
> seem to have a double-buffering error where old content from a portion of
> the screen where the widget is supposed to be displays previously displayed
> content at that location, rather than the correct content.
> Some of them show the correct content for a second or two and then revert to
> blank.
>
>
> It may be that the VTK build needs to be done with different flags, or some
> known incompatibility exists, or anything else. If anyone has run into this
> your help would be appreciated, or short of seeing the problem specifically
> any suggested debugging strategies would be great.

Hm, I don't think I've seen this problem, but I dug up an old version
of our app that used QVTKWidget (we've since ported to
QVTKOpenGLWidget), and in our QVTKWidget subclass, we had:

    QSurfaceFormat surfaceFormat = window->format();
    surfaceFormat.setSamples(0);
    surfaceFormat.setStencilBufferSize(8);
    window->setFormat(surfaceFormat);

I remember the setStencilBufferSize(8) call was some workaround for
some zbuffer issue we had with QVTKWidget+OpenGL2. I can't remember
the details, but perhaps you could try that out?

Though the recommended thing I think is to port to QVTKOpenGLWidget first.

Elvis

>
>
> With thanks,
>
> Andy
>
>
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list