Reputation: 18950
I'm using Qt 5.13 and VTK 8.2 on macOS 10.14.
The class QVTKWidget
is deprecated:
Generic Warning: In /tmp/vtk-20191113-28696-10p6vfr/VTK-8.2.0/GUISupport/Qt/QVTKWidget.cxx, line 83 QVTKWidget was deprecated for VTK 8.1 and will be removed in a future version.
but if I switch to QVTKOpenGLWidget
I get this error:
ERROR: In /tmp/vtk-20191113-28696-10p6vfr/VTK-8.2.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 754 vtkGenericOpenGLRenderWindow (0x7f92e905e800): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue.
How to request the new OpenGL core profile in Qt?
OpenGL Extension Viewer shows that the supported OpenGL version of this MacBook is 4.1.
Specifying the OpenGL format as described here https://wiki.qt.io/How_to_use_OpenGL_Core_Profile_with_Qt#Specifying_the_OpenGL_Format does not make a change.
Upvotes: 3
Views: 1722
Reputation: 18950
Found the answer in QVTKOpenGLWidget.h.
Adding:
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
before the QApplication
instantiation fixed the problem.
Upvotes: 4