In Qt6 Qt has changed the default renderer for Qt windows in MS Windows to use Direct3D instead of OpenGL. FreeCAD requires that the window be rendered with OpenGL, and if it isn’t then when we add our QOpenGLWidget (the MDIView) to the window, the program crashes with the error:
The top-level window is not using OpenGL for composition, 'D3D11' is not compatible with QOpenGLWidget
I can work around this by setting a Windows environment variable,
QSG_RHI_BACKEND=opengl
but that’s pretty awkward, and I don’t know how to make sure that happens for our users (something in the installer?). Does anyone know of any other way to force Qt6 to use OpenGL when rendering on Windows?
Very close! (I think…) I’m still fighting with a few random crashes. I hope to push an alpha version this next week, but it’s not quite ready for primetime yet. It’s more than just Qt6, I wanted to update the whole stack, including CLBundler itself (which was Python 2 code).
Not in the short term, coin3d requires OpenGL. So to leave OpenGL behind we would have to swap out coin3d, which is a big endeavour. Realthunder has been working on using a new renederer for some time, if I’m not mistaken that one is compatible with vullkan, d3d and metal. I don’t know what’s the status of that, I think there’s a few things that still don’t work.
I do believe that is something we should do in the long term, manufacturers don’t seem to pay much attention to openGL nowadays and many mobile chips (which are becoming more relevant every year) don’t even have regular desktop openGL support but only openGL ES, which is not compatible with coin3d either.