path: root/src/opengl
diff options
authorMartin Smith <>2016-11-22 10:31:12 +0100
committerMartin Smith <>2017-12-08 17:37:54 +0000
commitf4ad5ede58dd4e431d8fe8f93293934aa7094a78 (patch)
tree37c12482445acac45ff1ed2623ba43bc3f45767b /src/opengl
parent5a40143ed622cbd84d5c06afe6cb12017499f69b (diff)
doc: clangqdoc must always see GL typedefs
QT_NO_OPENGL must not be defined when running clangqdoc because there are opengl elements that must be documented. That means clang will see uses of GLxxx, which might not be included on some platforms. For example, clang must parse the declaration for class QOpenGLFramebufferObject, which uses GLuint, GLenum, and GLbitfield, because there is documentation to be published for that class in qopenglframebufferobject.cpp. This change uses Q_CLANG_QDOC to first undef the needed GLxxx types and then provide suitable typedefs for them. This technique is also used in qglshader.h. This works for macOS, but is it the right way to solve the problem? This change also removes some \overload commands, because they shouldn't be used on constructors. And some \fn commands that are made unnecessary by upgrading to clang. Change-Id: I4ac658e951b3f2011698005f0238d4dea85fc403 Reviewed-by: Martin Smith <>
Diffstat (limited to 'src/opengl')
1 files changed, 11 insertions, 0 deletions
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index 3ce88197d2..dfdef44b54 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -46,6 +46,17 @@
#include <QtGui/qvector4d.h>
#include <QtGui/qmatrix4x4.h>
+#if defined(Q_CLANG_QDOC)
+#undef GLfloat
+typedef double GLfloat;
+#undef GLint
+typedef int GLint;
+#undef GLuint
+typedef unsigned int GLuint;
+#undef GLenum
+typedef unsigned int GLenum;