title: Correct usages of QOpenGLFunctions
body: <p>I a currently working on using Qt5 gui module to access to OpenGL functions.
  Then I discover <code>QOpenGLFunctions</code> which is useful because :</p>
  
  <ul>
  <li>It wraps OpenGL for Desktop and OpenGL ES, making sure I am using the OpenGL API in a 'portable' way.</li>
  <li>I Don't have to worry about including OpenGL headers, Qt does it for me.</li>
  </ul>
  
  <p>Yet I have doubts about a correct way to use it.
  Following lines only list the three ways I know about using this class.
  My question is : Is there a good way to use <code>QOpenGLFunctions</code> ?</p>
  
  <p><strong>Inheriting from <code>QOpenGLFunctions</code></strong></p>
  
  <p>Qt official documentation says 'inherit you class from <code>QOpenGLFunctions</code> and use glXXXX classes like before. But I don't like this way as :</p>
  
  <ul>
  <li>If my class was expected to inherit from an other class before, I have to make multi-inheritance. Something I am not kind of. Even when such cases are safe anyways, it's aestethics...</li>
  <li>Every glXXXX wrapping classes are non-const. I would force all methods using OpenGL to be non-const. That does not make a lot of sens. Yes <code>OpenGLFunctions</code> class can legitimately be non-const when I do <code>glClear(...)</code>, but why my method <code>DrawableShape::render(...)</code> would be ?</li>
  </ul>
  
  <p>And about inherinting from <code>QOpenGLFunctions</code>. Its constructor may accept an argument : the current OpenGL context. This parameter seems very important to me, but no Qt documentation calls this constructor. Instead they let the compiler to choose the no-parameter constructor.</p>
  
  <p><strong>Having <code>QOpenGLFunctions</code> as member</strong></p>
  
  <p>An other idea should be to have an instance of <code>QOpenGLFunctions</code> as member of any class calling glXXXXX functions, or at least a reference to one instance, and call every OpenGL functions from this instance.</p>
  
  <p><strong>Passing <code>QOpenGLFunctions</code> as parameter</strong></p>
  
  <p>For each function using OpenGL, the caller send <code>QOpenGLFunctions</code>. This way :</p>
  
  <pre><code>void renderRectangle(QOpenGLFunctions&amp; opengl) const;
  </code></pre>
  
  <p>But how could I be sure <em>this</em> function will need it and <em>this</em> one won't ? I mean the source code will get bigger by the time and I fear the risk of seeing every methods of the classes receiving this parameter...</p>