title: Qt and OpenGL and draw a triangle if i use attributes
body: <p>I have a problem with a simple shader.
  I plan to draw a triangle (one for a start) in color. What i want: i culculete color for each node of triangle and give it to vertex shader, then pass to fragmant and get a colorfull triangle. What i get is nothing - no triangle. So i decided to simplify a littel - i give parameters to shaders, but i not use them. And i get same result. It's C++ code:</p>
  
  <pre><code>    QVector4D colors[3];
       ...       
      glBegin(GL_TRIANGLES);
          invers_sh.setAttributeValue("b_color", colors[1]);
          glVertex2d(0, 0);
  
          invers_sh.setAttributeValue("b_color", colors[1]);
          glVertex2d(2.0, 0);
  
          invers_sh.setAttributeValue("b_color", colors[2]);
          glVertex2d(0, 2.0);
  
  
      glEnd();
  </code></pre>
  
  <p>Vertex shader:</p>
  
  <pre><code>in vec4 vertex;
  attribute vec4 b_color;
  varying vec4 color_v;
  uniform mat4 qt_ModelViewProjectionMatrix;
  
  void main( void )
  {
      gl_Position = qt_ModelViewProjectionMatrix * vertex;
      color_v = b_color;
  }
  </code></pre>
  
  <p>Fragment shader:</p>
  
  <pre><code>varying vec4 color_v;
  
  void main( void )
  {
      gl_FragColor = vec4(1.0, 0, 0, 0);
  }
  </code></pre>
  
  <p>I figured that i get my red triangle if i comment all setAttributeValue in C++ code and line</p>
  
  <pre><code>color_v = b_color;
  </code></pre>
  
  <p>in vertex shader.
  Help me.</p>