I am using QT to load, compile and link OpenGL shaders.
I need to perform specific operations depending on the GLSLversion used in the shader code
Is it possible to recover the version from the QOpenGLShader interface without actually getting the shader source code and parsing it to detect the version line?
Neither Qt nor OpenGL gives access to the shader version (in the case of Qt, probably because it does not know it and does not need to). You are left with parsing the source code, however since
#version
needs to be on its own line, you should be able to extract what you want with just a split and basic string operations.