In Qt 6 many of the QT_CONFIG(opengl) and qtConfig(opengl) (in .pro and CMakeLists) checks become incorrect: with the introduction or RHI a -no-opengl build can still mean Vulkan, Metal, Direct3D, or any QRhi backend other than OpenGL. Or it can mean the Qt Quick software backend.
See https://code.woboq.org/qt5/qtdeclarative/src/quick/scenegraph/qsgrenderloop.cpp.html#83 for some background on this.
Once the direct OpenGL purging progresses, this needs to be tackled as well. (it probably not wise to do it too early, however)