title: minimalist PyOpenGL example in PyQt5 application
body: <p>I am learning <code>PyOpenGL</code> and use it in <code>PyQt5</code> application. I am trying to convert some of my old simple examples from <code>C++</code>/<code>Qt</code> to <code>Python</code>. The following example should draw white triangle on black background. At least it does in the corresponding <code>C++</code>/<code>Qt</code> code. But it does nothing, just a black window. Any ideas what I am missing? Note that I need the 'modern' approach using shaders (however according to my knowledge - I may be wrong - the following code should just use a default trivial shader, i.e white color in 2D) instead of all that oldish <code>glBegin()</code>, <code>glEnd()</code>.</p>
  
  <pre><code>import numpy as np
  from OpenGL import GL
  from PyQt5.QtWidgets import QOpenGLWidget, QApplication
  
  
  class OpenGLWidget(QOpenGLWidget):
  
      def initializeGL(self):
          vertices = np.array([0.0, 1.0, -1.0, -1.0, 1.0, -1.0], dtype=np.float32)
  
          bufferId = GL.glGenBuffers(1)
          GL.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferId)
          GL.glBufferData(GL.GL_ARRAY_BUFFER, vertices.size, vertices, GL.GL_STATIC_DRAW)
  
          GL.glEnableVertexAttribArray(0)
          GL.glVertexAttribPointer(0, 2, GL.GL_FLOAT, GL.GL_FALSE, 0, 0)
  
      def paintGL(self):
          GL.glDrawArrays(GL.GL_TRIANGLES, 0, 3)
  
  
  app = QApplication([])
  widget = OpenGLWidget()
  widget.show()
  app.exec_()
  </code></pre>