Glitches when passing from QVTKWidget to QVTKOpenGLWidget


There’s this project I’m using in one of my company’s product it’s a slippy map.

In applications/weatherstations, there’s an example of a Qt application using that project. A QVTKWidget is used to display the map :

I changed the QVTKWidget / vtkRenderWindow by a QVTKOpenGLWidget / vtkGenericOpenGLRenderWindow and everything is glitchy :

I didn’t forget to add this before QApplication :

I compiled the application under 3 different systems (Windows 8, KUbuntu and Centos 7) with different GPUs and the result is always the same (glitchs or the map tiles are not displayed).

When using that project in a program where ParaView is embedded, there’s no glitchs with QVTKOpenGLWidget (see :

So, I believe there’s a cure for these glitches but I didn’t find it !

Setting surface format is just part of the story. Qt/VTK application initialization steps are very delicate - you need to perform all the steps and in the correct order. I would recommend to copy the steps from large projects, such as Paraview, because several developers worked very hard on getting those right and they are tested by thousands of users on various platforms.

Hi @lassoan

I did, but I still have glitches ! Do you know which version of VTK ParaView 5.4.1 is based ? I didn’t find that info. I want to build that VTK version and try with vtkMap, because when I’m using the VTK classes from ParaView 5.4.1 libraries I don’t have glitches in vtkMap.


You can ask such details about Paraview on their forum.

ParaView doesn’t track a VTK release, but a commit on the master branch at some point. 5.4.1 uses VTK commit a9b132548dc19b8e20898b424b31cafacbf39246.

1 Like

Thank you very much @cory.quammen

With the same code (weather stations Qt example from vtkMap) :

With VTK 8.0.0.rc1-54-ga9b1325 (the one used in ParaView 5.4.1), there’s no glitches :


With VTK 8.2.0 (I initialized the QSurface properly)

With the latest VTK from master (using QVTKOpenGLStereoWidget and QVTKRenderWindowAdapter::defaultFormat to initialize the QSurfaceFormat’s default format)

I managed to have this result by playing with the camera (possible with 8.2.0 too)

but this is the first result :

Otherwise, without using Qt (X11 window ?), there’s no glitches with all the versions.